Closing a cmd window / program started by cmd after batch file execution

Closing a cmd window / program started by cmd after batch file execution , 
@echo off 
start pskill.exe -t notepad.exe 
TASKKILL /F /IM pskill.exe /T 
TASKKILL /F /IM cmd.exe /T 
EXIT /B
@echo off - That results in command prompts being hidden.

pskill.exe  -  Running PsKill with a process ID directs it to kill the process of that ID on the local computer. If you specify a process name PsKill will kill all processes that have that name.


TASKKILL -  End one or more processes (by process id or image name).

refer - https://ss64.com/nt/taskkill.html

EXIT /B    -  Quit the current batch script, quit the current subroutine or quit the command processor (CMD.EXE) optionally setting an errorlevel code.

refer - https://ss64.com/nt/exit.html

No comments:

Post a Comment

Pages