# DOS Command 4 changing IP (Please Help)



## Duckman69 (Jun 26, 2007)

Does any1 rember the dos command for changing your ip threw command prompt, thank you for your help in advance it is much appricated...


----------



## ghostdog74 (Dec 7, 2005)

here's an example vbscript

```
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
```


----------



## ViprXX (May 12, 2007)

do you mean type ipconfig /release and press Enter. Then, type ipconfig /renew in command prompt?


----------



## JohnWill (Oct 19, 2002)

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.


----------



## ChuckE (Aug 30, 2004)

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 (Jun 26, 2007)

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...


----------

