Hi,
This is my first VBScript, so I may need a little walking through here.
Basically, I have a script to kill all running VPN's, then open a certain VPN client and input username and password, connect to the VPN, edit a text file and open an EXE that uses TCP/IP.
The problem I am having is that when opening the VPN client (specifically Sonicwall) I can't seem to time it right to input username and password, and if I do time it right on my machine, it doesn't work on someone else's slower machine.
I need to edit my script to wait till Sonicwall has finished opening, press CTRL+B (connect) and then input the username and password.
This is currently the script I am using:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """C:\Program Files\SonicWALL\SonicWALL Global VPN Client\SWGVpnClient.exe""",0,true
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
wscript.Sleep 5000
oshell.sendkent "^b"
oshell.sendkeys "U"
oshell.sendkeys "S"
oshell.sendkeys "R"
oshell.sendkeys "N"
oshell.sendkeys "M"
oshell.sendkeys "E"
oshell.sendkeys "{Tab}"
oshell.sendkeys "P"
oshell.sendkeys "A"
oshell.sendkeys "S"
Help is much appriciated.
Cheers
This is my first VBScript, so I may need a little walking through here.
Basically, I have a script to kill all running VPN's, then open a certain VPN client and input username and password, connect to the VPN, edit a text file and open an EXE that uses TCP/IP.
The problem I am having is that when opening the VPN client (specifically Sonicwall) I can't seem to time it right to input username and password, and if I do time it right on my machine, it doesn't work on someone else's slower machine.
I need to edit my script to wait till Sonicwall has finished opening, press CTRL+B (connect) and then input the username and password.
This is currently the script I am using:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """C:\Program Files\SonicWALL\SonicWALL Global VPN Client\SWGVpnClient.exe""",0,true
Dim oShell
Set oShell = WScript.CreateObject ("WScript.Shell")
wscript.Sleep 5000
oshell.sendkent "^b"
oshell.sendkeys "U"
oshell.sendkeys "S"
oshell.sendkeys "R"
oshell.sendkeys "N"
oshell.sendkeys "M"
oshell.sendkeys "E"
oshell.sendkeys "{Tab}"
oshell.sendkeys "P"
oshell.sendkeys "A"
oshell.sendkeys "S"
Help is much appriciated.
Cheers