Skip to content

Instantly share code, notes, and snippets.

@uisuru
Created February 7, 2018 19:38
Show Gist options
  • Save uisuru/e6997dc4caf837d7d1009baacfc2c8d2 to your computer and use it in GitHub Desktop.
Save uisuru/e6997dc4caf837d7d1009baacfc2c8d2 to your computer and use it in GitHub Desktop.
Small batch file. This will terminate a single process with provided PID
@ECHO OFF
if not "%1"=="am_admin" (powershell start -verb runas '%0' am_admin & exit)
SET /P MyPID=Please enter your PID:
IF "%MyPID%"=="" GOTO Error
ECHO This %MyPID% PID will terminate
GOTO End
:Error
ECHO You did not enter PID
:End
pause
taskkill /PID %MyPID% /t
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment