Eru Posted March 20, 2007 Posted March 20, 2007 What functions should I look at to change the settings of my TCP/IP settings via a script? My situation is this: I have a laptop and my router at home uses static IP addresses, but when I take my laptop to the coffee shop or school where they use DHCP, I have to change it manually, and then change it back when I get home. It takes like 10 seconds to do and I may be being lazy, but I'd like to make a program that will change my TCP/IP settings from automatic configuration to manual config, and vice versa. Thanks!
tAKTelapis Posted March 20, 2007 Posted March 20, 2007 %windir%\system32\netsh.exe interface ip set address name="Local Area Connection" source=dhcp Create a shortcut on your desktop, that^ one, will set your adapter to DHCP for automatic addressing, the next one will change it to a static IP. these are just statements that will work inside of a batch file, or straight from a run dialog box, they use the netsh program that comes with windows XP (not sure of other versions of windows). c:\windows\system32\netsh.exe interface ip set address name="Local Area Connection" static 192.168.0.1 255.255.255.0
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now