Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IP Config Batch file 1

Status
Not open for further replies.

ianmac69

Instructor
Feb 3, 2003
10
0
0
AU
Hi All,

One the odd occasion i have a user who works in two locations however they both have diffrent ip address ranges.
Is there a command line that can be run that will allow you to change the ip address on the fly.
Getting this user to do anything more than a mouse click is a big job
"ok just right click on the icon....no that was a left click, just try the other right click"
 
Since you're mentioning IPCONFIG, I assume you're using DHCP at both locations, and just need to issue a /RELEASE and /RENEW each time.

Just create a new text file, and save it as WHATEVER.BAT (you may have to monkey with explorer's handling of file extensions to do this).

Three lines should work:

IPCONFIG /RELEASE
IPCONFIG /RENEW
PAUSE

Then run the file. The PAUSE line will prompt them to hit any key to continue, which should close the window. If it doesn't you can edit the properties of the batch file to auto-close when finished.
 
The command used for this purpose is NETSH. It allows you to save TCP/IP configuration files for each setting and apply them at a later time to restore the settings. It is easy to create a batch file to run for each network setting to set the appropriate TCP/IP configuration. A small tutorial can be found here:
 
Thanks for your sugestions all,

"bcaster" thanks that will definatly work, Much appreciated.

Unfortunatly one end has a static ip address range so the earlier will not work but thanks for the reply though.

 
Bill

nice read - I've skimmed the site before (and liked what I've seen), but not looked at anything in depth. As you say, good site.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top