This file opened in a new window - close the window to return |
How to set your Internet Protocol (TCP/IP) address using a batch file |
IntroductionWarning: This file runs in Command Mode: Use at your own risk Changing TCP/IP settings can be quite time consuming using the 'Network Connections' route every time. This file will change your settings for you with one or two clicks. Create a separate file for each location and save them in a convenient place. Running the file will then set your TCP/IP for that location.
Set-up instructionsDownload the text file. Open it with Notepad (NOT Word or Wordpad or any other word processing software) Change the settings to suit your system Save it as a batch file (with the suffix .bat) You can download the text file by clicking this link. There is more info on how to edit the file at the bottom of this page NOTES 1. You usually have to have Administrator privileges to run files 2. Vista users may have to right click on the file icon and use 'Run as administrator' NOTES This MORE INFO This file runs in Command Mode. Use at your own risk. The bits you may need to alter are coloured purple STEP ONE: Download the text file (see link above) and open it in Notepad. (Right click - IE: Save target as/ Firefox: Save link as). DO NOT try to run the text on this page as code Firstly you need to change the name in the inverted commas in this line The name in the inverted commas must match your connection name. The name in our example is the default name for the Wireless Network connections in Vista. You may have names like "Wireless Network Connection (4) or "Ethernet (2) etc etc STEP TWO:
set ipsubnet=192.168.1
STEP THREE: Next set the subnet address for the DNS servers. STEP FOUR: Next change the code below to add the fourth number to the ip address for the LAN and the Gateway. Here we have used 150 for the lan-ip and 254 for the gateway. Your numbers will probably be different rem Set each of IP address, Subnet mask and Default gateway STEP FIVE: Next change the code below to add the fourth number to the DNS address. In our example we've used the numbers 69 for the Primary (or Preferred) DNS and 68 for the Secondary (or Alternative). Your numbers will probably be different rem Set both the DNS values The following code does the work and does not need to be altered. rem set the ip address
This will give you TCP/IP settings as shown below Save the file with the suffix .bat for example homenetwork.bat or office1.bat --- you will need to add the suffix in the Notepad 'Save as' dialogue box otherwise it will save as a text file.
|