|
|
|
|
![]() ![]() |
![]() Group: Members
Posts: 14 Joined: 20-June 06 From: 19°28'E 51°47'N Member No.: 25,432 |
Post
#1
Jun 23 2006, 04:04 AM
How To: IP Configuration Script (win XP) If you travel a lot with your laptop, and need to switch between different IP's in different locations, this script is for you. There are many programs that handle this task very well, but they cost sometimes pretty big money. This tutorial will show you how to make your own IP Configuration Script for free. This script is for a static ip address configuration and is based on a little program called "NETSH.EXE" which is supplied with Windows. How it works. QUOTE Microsoft Windows XP - Using Netsh Netsh.exe is a command-line scripting utility that allows you to, either locally or remotely, display or modify the network configuration of a computer that is currently running. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a specified computer. Netsh.exe can also save a configuration script in a text file for archival purposes or to help you configure other servers. OK. Let's get down to the business. First of all, will need to create a batch (.bat) file and a text file (.txt) I will explain the contens of the text file later on. 1. In our batch file, wee will put the code as follows. CODE @echo off netsh.exe exec textfile.txt if not errorlevel 1 goto allok echo. echo ERROR !!! echo. pause goto end :allok echo. echo NETSH exec .......... OK! echo. :end In the second line of our batch file wee execute NETSH.exe with a command-line parameter. The command-line parameter is the path and name of our text file (or just the name if both files will bee stored in the same directory) In the next lines of the batch file is a simple error handler. 2. In our text file, wee will put the code as follows. CODE interface ip set address name="Wireless" source=static addr=10.3.123.123 mask=255.255.0.0 set address name="Wireless" gateway=10.1.0.0 gwmetric=0 set dns name="Wireless" source=static addr=88.77.77.3 add dns name="Wireless" addr=163.29.251.110 add dns name="Wireless" addr=194.244.159.1 add dns name="Wireless" addr=195.130.20.131 set wins name="Wireless" source=static addr=none The "interface ip" command branches to a submenu in the NETSH.exe program. The "set address name" command configures the IP, the sub-net mask and the default gateway address. The name "Wireless" is an example interface name, change it to the interface name you want to configure. In the fourth and lower lines, the "addr" values are the IP addresses of your DNS servers. In the last line, the "addr" value is the WINS server IP address. NOTE: Remember to save the text file under the same name you have specifiedin the batch file, and to save the batch file with the .BAT extention. This is my first tutorial and i hope it will be useful for someone. |
![]() ![]() |
Similar Topics
| Topic Title | Replies | Topic Starter | Views | Last Action | |||
|---|---|---|---|---|---|---|---|
![]() |
5 | Shibbeh | 16,074 | 20th August 2004 - 10:04 PM Last post by: ill |
|||
![]() |
9 | shadowx | 3,222 | 12th October 2009 - 07:12 PM Last post by: manish-mohania |
|||
![]() |
4 | xmae | 9,133 | 24th August 2006 - 03:21 PM Last post by: juice |
|||
![]() |
7 | football123213 | 15,572 | 20th August 2004 - 12:25 AM Last post by: ill |
|||
![]() |
15 | -prodigy- | 14,130 | 27th February 2005 - 10:22 PM Last post by: alexia |
|||
![]() |
2 | -Pandemonium- | 12,053 | 22nd August 2004 - 04:25 AM Last post by: -Pandemonium- |
|||
![]() |
8 | -Pandemonium- | 9,295 | 25th August 2004 - 04:00 PM Last post by: -Pandemonium- |
|||
![]() |
0 | Raptrex | 7,103 | 6th September 2004 - 11:19 PM Last post by: Raptrex |
|||
![]() |
11 | dozen | 10,440 | 13th September 2004 - 07:26 PM Last post by: melkonianarg |
|||
![]() |
4 | spyshow | 6,541 | 21st September 2004 - 03:19 AM Last post by: Spectre |
|||
![]() |
3 | XtremeGamer99 | 6,272 | 27th September 2004 - 12:31 PM Last post by: LuciferStar |
|||
![]() |
0 | deejames | 4,500 | 24th September 2004 - 02:23 AM Last post by: deejames |
|||
![]() |
6 | spyshow | 6,283 | 24th June 2009 - 09:06 PM Last post by: iworld200 |
|||
![]() |
9 | clouds421 | 4,587 | 24th October 2004 - 11:14 PM Last post by: atomic3 |
|||
![]() |
3 | Triple X | 9,573 | 18th December 2008 - 10:52 PM Last post by: minimcmonkey |
|||
|
Open Discussion | Time is now: 7th November 2009 - 02:05 AM |
Web Hosting Powered by ComputingHost.com.