VISTA UPDATE
Switch Network Settings With Batch Files
- For Vista users only, I've written it here as well-
@ECHO OFF
Set varip=192.168.1.100
Set varsm=255.255.255.0
Set vargw=192.168.1.1
Set vardns1=66.78.202.254
Set vardns2=66.78.210.254
ECHO Setting IP to static
Netsh int ipv4 set address name = �Wireless Network Connection� source = static address = %varip% mask = %varsm%
ECHO Setting IP Address and Subnet Mask
Netsh int ipv4 set address name = �Wireless Network Connection� address = %varip% mask = %varsm% gateway = %vargw% gwmetric = 1
ECHO Setting Primary DNS
Netsh int ip set dns name = �Wireless Network Connection� source = static addr = %vardns1%
ECHO Setting Secondary DNS
Netsh int ip add dns name = �Wireless Network Connection� addr = %vardns2%
ECHO Here are the new settings for %computername%:
Netsh int ip show config
Pause
The change is quite simple�the problem seems to lie in vista�s inability to set the ip to static, and assign the ip address at the same time. So all you have to do is set up the ip to static first, then set the ip�very strange!
Note that your static ip is not displayed when shown, however it is set.
Just change the variables at the beginning to your settings and if needs be, change "wireless network connection" to the name of your connection eg. "LAN-verbinding 4"
-reply by Razzor
Reply