Link to home
Start Free TrialLog in
Avatar of Bigdoggit
Bigdoggit

asked on

Need help on netsh script

I would like to have script files on my desktop I can double click and quickly change my network settings.  However, the dns addresses are not taking.  I will run the script and the ip address works great, but the dns will just change from dynamic to static, without entering addresses.  Can anyone see what I am doing wrong?  I attached my script file
# ---------------------------------- 
# Interface IP Configuration         
# ---------------------------------- 
pushd interface ip
 
# Interface IP Configuration for "Local Area Connection"
 
set address name="Local Area Connection" source=static addr=192.168.1.5 
 
mask=255.255.255.0 gateway=192.168.1.1 gwmetric=0
set dns name="Local Area Connection" source=static addr=192.168.0.1
add dns name="Local Area Connection" addr=192.168.1.1 
netsh int ip set wins name="Local Area Connection" source=static addr=none
 
# Interface IP Configuration for "Wireless Network Connection 2"
 
set address name="Wireless Network Connection 2" source=dhcp 
set dns name="Wireless Network Connection 2" source=dhcp
set wins name="Wireless Network Connection 2" source=dhcp
 
popd
# End of interface IP configuration

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of James Montgomery
James Montgomery

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Gastone Canali
Gastone Canali
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
::
::I forgot the enableDhcp.cmd ..
::
wmic nicconfig where  description="Local Area Connection"  call EnableDHCP
Forced accept.

Computer101
EE Admin