Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- setlocal
- rem =========================
- rem == parsing parameters ==
- set exe_name=%~1
- if "%~1" EQU "" (
- goto :help
- )
- if "%~1" EQU "-h" (
- goto :help
- )
- if "%~1" EQU "/h" (
- goto :help
- )
- if "%~1" EQU "?" (
- goto :help
- )
- if "%~1" EQU "/?" (
- goto :help
- )
- shift
- for %%A in (/A /a a A) do (
- if "%~1" EQU "%%A" (
- set "all=/A"
- )
- )
- for %%V in (/V /v v V) do (
- if "%~1" EQU "%%V" (
- set "verbose=/V"
- )
- )
- shift
- for %%A in (/A /a a A) do (
- if "%~1" EQU "%%A" (
- set "all=/A"
- )
- )
- for %%V in (/V /v v V) do (
- if "%~1" EQU "%%V" (
- set "verbose=/V"
- )
- )
- rem =========================
- for /f "tokens=2 delims= " %%M in ('tasklist ^| find ^"%exe_name%^"') do (
- tskill "%%M" %verbose% %all%
- )
- endlocal
- goto :eof
- :help
- echo.
- echo %~n0 - allows you to kill a process by image without administrator permissions.
- echo.
- echo %~n0 executable [/V] [/A]
- echo.
- echo executable executable to be terminated.
- echo /V verbose information
- echo /A End process running under ALL sessions
- echo.
- echo by Vasil "npocmaka" Arnaudov
- goto :eof
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement