使用powershell/ target=_blank class=infotextkey>shell脚本配置静态IP地址,很简单,几行代码即可搞定。
脚本内容:
复制代码 代码示例:
$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'"
$wmi.EnableStatic("192.168.1.15", "255.255.255.0")
$wmi.SetGateways("192.168.1.1", 1)
$wmi.SetDNSServerSearchOrder("8.8.8.8")