Jump to content
TorGuard
Taurean

Batch Script to Launch VPN and BT Clients

Rate this topic

Recommended Posts

Taurean

Save the following as a .bat file...

@ECHO OFF

COLOR 1F

SETLOCAL

REM Program paths and filenames:
REM ---------------------------------EDIT---------------------------------------
SET "VPNPATH=C:\Program Files (x86)\VPNetwork LLC\TorGuard"
SET "VPNFILE=TorGuardDesktopQt.exe"
SET "CLIENTPATH=C:\Program Files\BiglyBT"
SET "CLIENTFILE=BiglyBT.exe"
REM -------------------------------END EDIT-------------------------------------

ECHO VPN and BT launcher 
ECHO ---------------------

TASKLIST /FI "IMAGENAME EQ %VPNFILE%" 2>NUL | FIND /I /N "%VPNFILE%">NUL

IF "%ERRORLEVEL%"=="1" (
	TIMEOUT /T 10 /NOBREAK
	ECHO.
	ECHO Starting %VPNFILE%
	START "VPN" /B "%VPNPATH%\%VPNFILE%"
	TIMEOUT /T 30
	ECHO.
)

TASKLIST /FI "IMAGENAME EQ %CLIENTFILE%" 2>NUL | FIND /I /N "%CLIENTFILE%">NUL

IF "%ERRORLEVEL%"=="1" (
	ECHO Starting %CLIENTFILE%
	TIMEOUT /T 10 /NOBREAK
	START "BT" /B "%CLIENTPATH%\%CLIENTFILE%"
	ECHO.
)

ECHO DONE!
TIMEOUT /T 5

ENDLOCAL
EXIT

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×