打开应用执行命令(连接VPN).note

noteId: WEBc96de57ccb7644a76005361c5e4e65ff · 原始路径:/ALL/Windows - B模块/服务配置/Windows Powershell/powershell、cmd 命令/打开应用执行命令(连接VPN).note · 图片:2 · 附件待处理:0

 
# 题目:
打开 notepad时,自动连接VPN
 
 
while ($true) {
    if (Get-Process notepad -ErrorAction SilentlyContinue) {
        rasdial SSTP administrator@branch.cn2026.wsc Ski1ls39MO
        sleep 2
    }
    sleep 2
}
 
测试:
打开 notepad 后,VPN也自动连接了: