VMware Communities
FzerozeroT
Contributor
Contributor

Solution: Batch file / script to quickly change IP address

Hi, I was trying to find a way to quickly roll out clients and needed to change IPs, here's my solution (for windows), hope you enjoy, now if I can just point you over to my question Smiley Wink

http://communities.vmware.com/thread/158139

::

::Change IP

::

::You will need to run this with admin rights, under Vista this means "Run as administrator"

::

::If you need to alter your addresses alter the second and third line to your allocated blocks

::The only "user input" is %variable% in the second line the others are static from the values in here

::If you wish to alter the third value with input simply delete it from in front of %variable% and enter it at the prompt

::Check that the connection that you are trying to change corresponds with the one in quotes

::

::Any trouble just ask

::E-mail removed sorry (company internal)

::

@echo off

SET /P variable=Please enter the IP to change to: 172.0.0.

netsh interface ip set address name="Local Area Connection" static 172.0.0.%variable% 255.255.0.0 172.0.0.0 1

netsh interface ip set dns "Local Area Connection" static 172.0.0.0

echo If there are no error messages then your IP has probably been set.

pause

Reply
0 Kudos
3 Replies
Peter_vm
Immortal
Immortal

Fantastic. I would post it rather is MS groups.

Reply
0 Kudos
FzerozeroT
Contributor
Contributor

are you talking about the Microsoft groups or is there a separate section in VMware communities somewhere?

Reply
0 Kudos
Peter_vm
Immortal
Immortal

MS as the subdivision of VMware? The other way round is more likely. Smiley Wink

Reply
0 Kudos