"Internet Protocol Version 4 (TCP/IPv4)" 在 AutoHotKey 中

"Internet Protocol Version 4 (TCP/IPv4)" in AutoHotKey

这个自动热键程序只会让我完成一部分。 我需要 select "Internet Protocol Version 4 (TCP/IPv4)" 并单击 "Wireless Network Connection Properties"

上的属性
Run ncpa.cpl 
WinWaitActive Network Connections
SendInput {Tab 4}{Right}!{Enter} ; change {Tab 4} to suit the position of  your specific connection in the Connections list
WinWaitActive Wireless Network Connection Properties ; change the title if necessary, for example, if you're on LAN.
SendInput {Down 4}!r

我假设你想更改设备的 IP 地址?

更改 ip 和网关:

Run, PowerShell New-NetIPAddress –InterfaceAlias “Wireless Network Connection” –IPv4Address “192.168.0.1” –PrefixLength 24 -DefaultGateway 192.168.0.254

更改主要和次要 DNS 服务器:

Run, PowerShell Set-DnsClientServerAddress -InterfaceAlias “Wireless Network Connection” -ServerAddresses 192.168.0.1, 192.168.0.2