Jump to content
TorGuard
Taurean

Batch Script to Start / End BT Client on Windows

Rate this topic

Recommended Posts

Taurean
@ECHO OFF

SETLOCAL

REM Program path and filename:
REM ---------------------------------EDIT---------------------------------------
SET "CLIENTPATH=C:\Program Files\BiglyBT"
SET "CLIENTFILE=BiglyBT.exe"
SET "EXITCMD="--closedown"
REM ---------------------------------END----------------------------------------

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

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

IF "%~1" == "start" (
	IF "%ERRORLEVEL%"=="1" (
		ECHO Starting %CLIENTFILE%
		START "BT" /B "%CLIENTPATH%\%CLIENTFILE%"
	)
) ELSE IF "%~1" == "end" (
	IF "%ERRORLEVEL%"=="0" (
		ECHO Exiting %CLIENTFILE%
		START "BT" /B "%CLIENTPATH%\%CLIENTFILE%" %EXITCMD%
	)
ELSE (
	ECHO Something is missing or wrong parameters!
)

ENDLOCAL
EXIT

Usage: file.bat "start" / "end"

 

 

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

×