reip(a,b){
power := "ahk_class ConsoleWindowClass"
UniqueID := WinExist(power)
rei(a,b){
Winwait(power)
WinActivate(power)
Send "netsh interface ip set address name=`"以太网`" static 192.168."
send a
send "."
send b
Send " 255.255.255.0"
send "{Enter}"
}
if(UniqueID=0){
Run "powershell"
rei(a,b)
}else{
rei(a,b)
}
}
!k::{
reip(100,100)
}
!i::{
reip(1,100)
}
!u::{
reip(11,254)
}
!p::{
reip(255,255)
}
这几个是预设
!k::{
reip(100,100)
}
!i::{
reip(1,100)
}
!u::{
reip(11,254)
}
!p::{
reip(255,255)
}
禁用,启用网卡
seti(c){
UniqueID := WinExist("ahk_class ConsoleWindowClass")
set(c){
Winwait("ahk_class ConsoleWindowClass")
WinActivate("ahk_class ConsoleWindowClass")
Send "netsh interface set interface `"WLAN`" "
Send c
send "{Enter}"
}
if(UniqueID=0){
Run "powershell"
set(c)
}else{
set(c)
}
}
>!m::{
seti("disabled")
}
>!j::{
seti("enabled")
}