Menü schliessen
Created: March 3rd 2012
Categories: IT Support
Author: Marcus Fleuti

ShrewSoft command line VPN dial-in/hangup scripts (batchfiles for automating xAuth/regular VPN dial-in)

Donation Section: Background
Monero Badge: QR-Code
Monero Badge: Logo Icon Donate with Monero Badge: Logo Text
82uymVXLkvVbB4c4JpTd1tYm1yj1cKPKR2wqmw3XF8YXKTmY7JrTriP4pVwp2EJYBnCFdXhLq4zfFA6ic7VAWCFX5wfQbCC

Using these batchfiles the procedure for VPN dial-in and hangup can be automated to ease things up for the user:

ShrewSoft VPN dial-in command line script (xAuth)

@echo off
echo Connecting VPN...
start "vpn" "C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r "VPN_Profile_Name" -u xAuth_Username -p xAuth_Password -a
echo Trying to reach server on remote network...
ping -n 5 192.168.1.1
echo Connecting network drives (delete existing first if any)...
net use h: /delete /y
net use p: /delete /y
net use h: \\192.168.12.10\homes /persistent:no /y
net use p: \\192.168.12.10\public /persistent:no /y

Shrewsoft VPN dial-in command line script (regular dial-in)

@echo off
echo Connecting VPN...
start "dialing_vpn" ""C:\Program Files\ShrewSoft\VPN Client\ipsecc.exe" -r "VPN_Profile_Name" -a
echo Trying to reach server on remote network...
ping -n 5 192.168.1.1
echo Connecting network drives (delete existing first if any)...
net use h: /delete /y
net use h: \\192.168.12.10\homes /persistent:no /y

Shrewsoft VPN hangup command line script (common)

@echo off
echo Disconnecting network drives...
net use h: /delete /y
echo Hanging up...
taskkill /T /F /IM "ipsecc.exe"