Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: is there a way to....

06 Aug 2010   #1
freaky88

MS Windows 7 Home Premium 64-bit
 
 
is there a way to....

is there a way to make a .bat file to automatically change my dns?


My System SpecsSystem Spec
.
06 Aug 2010   #2
cluberti

Windows 10 Pro x64
 
 

Sure, you can have it call netsh:
Code:
::// Below sets a network card called "Local Area Connection" to use 192.168.0.1 and 192.168.0.2
::// Use netsh interface ipv4 show interfaces to get the "name" of the LAN connection(s):
netsh interface ipv4 set dnsservers name="Local Area Connection" static 192.168.0.1 validate=no
netsh interface ipv4 add dns "Local Area Connection" 192.168.0.2 index=2 validate=no

::// Below will set the interface back to getting the data from a DHCP server:
netsh interface ipv4 set dnsservers name="Local Area Connection" dhcp
My System SpecsSystem Spec
Reply

 is there a way to....




Thread Tools



Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 14:36.
Twitter Facebook Google+ Seven Forums iOS App Seven Forums Android App