DOS Command 4 changing IP (Please Help)

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Duckman69

Thread Starter
Joined
Jun 26, 2007
Messages
818
Does any1 rember the dos command for changing your ip threw command prompt, thank you for your help in advance it is much appricated...
 
Joined
Dec 7, 2005
Messages
146
here's an example vbscript
Code:
Set Adapters=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2").ExecQuery("select * from Win32_NetworkAdapterConfiguration where IPEnabled=true")

IPArray = Array("192.168.1.100")
MaskArray = Array("255.255.255.0")
GatewayArray = Array("192.168.1.1")
GatewayMetric = Array(1)
For each NIC in Adapters
   NIC.EnableStatic IPArray, MaskArray
   NIC.SetGateways GatewayArray, Gatewaymetric
Next
 
Joined
May 12, 2007
Messages
392
do you mean type ipconfig /release and press Enter. Then, type ipconfig /renew in command prompt?
 

JohnWill

Retired Moderator
Joined
Oct 19, 2002
Messages
106,429
Depending on what you're connected to, you can't simply change your IP address. Perhaps if you told us what you are doing, and what environment you're in, that would help.
 
Joined
Aug 30, 2004
Messages
2,311
If you are getting your IP address from an ISP (Internet Service Provider) you can't change what they assign you. Your IP address is whatever they, usually, dynamically assign you. Meaning, that while your IP address may be the same, from day to day, since they usually use their same assignments from day to day; there is nothing to stop them from changing it on you. That is, UNLESS you are paying more for a fixed IP address, and in that case, you still can't change it.

It you have a home router, and your computer is getting a dynamic address from it, then while you can release the current address and then renew the IP address. The chances are that your home router will give you the same address again, unless you happen to have other devices grabbing dynamic addresses in-between the time you've released and then renewed.

Now, if you do have a home router, and you want to define your own IP address (making it static) you probably can do so (depends upon your router). But to do so, you will still be limited to a range of addresses that your home router can used, most probably in the 192.168.*.* range.

To set your computer to a static address is not done normally from a command line. But, I would not rule out some more elaborate command line calling up some clever registry change file.

To change a computer's static IP address would typically be done by changing your defined Network Connections, Local Area Connection Properties.
 

Duckman69

Thread Starter
Joined
Jun 26, 2007
Messages
818
Thanks for the vb script ill have to give it a go later this week & sorry about not having the information at the end of my posts im going to update that soon... im not on my regular computer thats getting fixed by gateway at the moment... shot my mo bo to hell

also thanks for the reply again chucke, with what you said lets say i wanted to change the ip manually the way you mentioned by going to tcp/ip settings & then properties i can assign a static ip ...

if i assign an ip i need to use the ISP range and then i can make the rest up myself... so if i set that up properly, what do i do with the preferred DNS & secondary DNS i havent done this in awhile i left them blank when i tried the 1st time and it wouldnt work no connection to internet... so if you know what i should do for the dns feild i would appricate it thanks...
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Staff online

Top