Danny King
Danny King

Reputation: 1991

Script to set windows (vista) DNS settings

I'd like to create a script that will toggle between setting the DNS settings of my wireless card between automatic selection and a particular IP (openDNS).

Can this be done, and if so what should I look in to?

Thanks!

Upvotes: 1

Views: 562

Answers (3)

Desmond Lee
Desmond Lee

Reputation: 1

Thanks for the link back. Here is some info that may be helpful:

Upvotes: 0

leosok
leosok

Reputation: 332

I would use netsh (google for it)

Upvotes: 0

Rihan Meij
Rihan Meij

Reputation: 1759

I personally would look at Powershell to do this. I found a post on how to change your ip settings in a one liner.

Get-WmiObject -class win32_networkadapterconfiguration | where-object -filterscript { $_.IPEnabled -eq ‘True’ -and $_.ServiceName -eq ‘E100B’ } | foreach-object -process { $_.EnableStatic(’192.168.1.200′,’255.255.0.0′) }

Author of this code's original post

Upvotes: 1

Related Questions