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

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

Windows 10 Pro x64

Sure, you can have it call netsh:
::// Below sets a network card called "Local Area Connection" to use and
::// 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 validate=no
netsh interface ipv4 add dns "Local Area Connection" 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

 is there a way to....

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 12:49.

Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App