AHK v2实例:快速更改网卡ip


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")
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值