wait for vpn connection to finish in batch file?
Posted: Mon Oct 27, 2014 9:03 pm
I am trying to write a bat file to:
1) Connect to VPN
2) Open RDP
3) Close VPN after RDP is closed.
So far:
start /wait vpncmd localhost /client /cmd AccountConnect <VPN Connection Here>
start /wait mstsc.exe <rdp file name>
start /wait vpncmd localhost /client AccountDisconnect <VPN Connection Here>
Notes:
Unfortunately, this seems to fire the RDP immediately. I'd lke to have it wait until after the IP Address window closes. I can manually time a break, but that does not really gaurantee a connection is established. Is there another vpncmd I can run using start /wait that will wait until an ip is established?
1) Connect to VPN
2) Open RDP
3) Close VPN after RDP is closed.
So far:
start /wait vpncmd localhost /client /cmd AccountConnect <VPN Connection Here>
start /wait mstsc.exe <rdp file name>
start /wait vpncmd localhost /client AccountDisconnect <VPN Connection Here>
Notes:
Unfortunately, this seems to fire the RDP immediately. I'd lke to have it wait until after the IP Address window closes. I can manually time a break, but that does not really gaurantee a connection is established. Is there another vpncmd I can run using start /wait that will wait until an ip is established?