开发者

Script to set windows (vista) DNS settings

开发者 https://www.devze.com 2022-12-17 08:38 出处:网络
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).

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!


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


I would use netsh (google for it)


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

  • Still Very Much Alive and Kicking - netsh

  • Tutorial PowerShell v3: TCP/IPv4 (and IPv6) Network Basics - Part I and Part II

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号