IP Configuration Selection

IP Configuration Selection


Every morning, I take my Acer notebook to work; in the evening, I take the notebook to class; at night, I take the notebook home. And every time I change locations, I need to reconfigure my IP settings. I don't like dynamic IP addressing; I want to know the IP address, gateway, and DNS server that I'm using whenever possible.

Certain tools (e.g., Softmate's IPSwitcher) let you select an IP configuration from several sets of configurations. However, the Netsh command achieves the same result. You can use Netsh to change your IP address, subnet mask, gateway, and DNS settings.

To configure IP settings, go to a command prompt and enter

netsh interface ip set 
  address name="local area 
  connection" source=static 1
netsh interface ip set dns 
  "Local area connection" 

The first Netsh command configures the local area connection settings. This command sets the IP address to, subnet mask to, gateway to, and gateway metric to 1. The second Netsh command sets the Preferred DNS Server setting to

I used the Microsoft Windows 2000 Server Resource Kit's Choice command to create a batch file to retrieve user input and the Netsh command to modify the IP settings according to that input. Listing 1 shows my batch file. The menu.txt file, which Listing 2 shows, contains my selection menu.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.