Hi all,

Been googling for hours but can't find any answers!!

What's the best way specifically for vista, to configure laptop IP address for 2 different networks?
I want to easily switch IP address detail when at home or in work.

I previously used netsh and scripts to do this in XP...but can't get it to work now in vista.
There seems to be differences in netsh in the move from XP - Vista

Thanks in advance

Paul

Dani AI

Generated

: Vista is fine for switching between a work static IP and a home DHCP address — two things usually bite users: the netsh context changed from XP (ip) to Vista/7 (ipv4), and User Account Control means scripts must be run elevated. 's "fallback" idea is exactly what the IPv4 "Alternate Configuration" handles (it uses your static values when DHCP times out). 's wireless-vs-wired idea also works: keep home on wireless (DHCP) and work on wired (static) so Windows uses the correct adapter automatically.

A reliable approach is two small scripts (run as Administrator) that call netsh. Example commands (replace the adapter name and addresses with your values):

netsh interface ipv4 show interfaces
netsh interface ipv4 show config

netsh interface ipv4 set address name="Local Area Connection" static 192.168.10.42 255.255.255.0 192.168.10.1
netsh interface ipv4 set dns name="Local Area Connection" static 192.168.10.1

netsh interface ipv4 set address name="Local Area Connection" dhcp
netsh interface ipv4 set dns name="Local Area Connection" dhcp

Troubleshooting: run the script with "Run as administrator" (or create a scheduled task that runs with highest privileges), confirm the exact adapter name with netsh interface ipv4 show interfaces, and verify after switching with ipconfig /all or netsh interface ipv4 show config. If you want a GUI, small utilities such as NetSetMan let you create and switch profiles without scripting.

Recommended Answers

All 4 Replies

DHCP?

In work it's a static IP address, so DHCP is not an option...thanks anyway

Somewhat hackish, but assuming you don't have a DHCP server at work, you could set your fallback to be your static configuration. At home, you'd get your dynamic IP, at work it would timeout and you'd use the static settings. Might that work?

does the home network have wireless, use the laptop at home wireless and wired at work

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.