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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...