Vbscript 登录脚本询问问题,然后启动vpn连接

Vbscript 登录脚本询问问题,然后启动vpn连接,vbscript,script,Vbscript,Script,我希望创建一个具有以下逻辑/要求的登录脚本 登录时弹出消息:是否要连接到VPN,是/否 如果是启动现有VPN连接框,则最终用户可以输入creds,如果creds已保存,则点击connect 如果否,则框消失 我从这个开始: x=msgbox("Corporate VPN Connection", 4+32, "You must connect to the VPN when not physically in the office. Do you wish to

我希望创建一个具有以下逻辑/要求的登录脚本

登录时弹出消息:是否要连接到VPN,是/否

如果是启动现有VPN连接框,则最终用户可以输入creds,如果creds已保存,则点击connect

如果否,则框消失

我从这个开始:

x=msgbox("Corporate VPN Connection", 4+32, "You must connect to the VPN when not physically in the office.  Do you wish to connect to the VPN now?")
显示框OK,但我需要更多关于如何将按钮点击链接到yes/no功能的指导


谢谢

您可以从以下代码开始:

Option Explicit
Dim Title,Message,Answer_Question

Title = "Corporate VPN Connection"
Message = "You must connect to the VPN when not physically in the office. Do you wish to connect to the VPN now ?"
Answer_Question = Msgbox(Message,VbQuestion+vbYesNo,Title)

If Answer_Question = vbYes Then 
    Wscript.echo "We are starting The VPN Connection"
Else 
' We quit the script
    Wscript.Quit
End If