1.

Solve : How to start and then later kill an exe from a .bat file???

Answer»

I've an .exe which i need to call through an .BAT file and then i need to kill this .exe at a later stage.
Please tell me how to do that??start file.exe
tskill fileQuote from: Anupam Sharma on MAY 20, 2010, 12:14:15 AM

I've an .exe which I need to call through an .bat file and then I need to kill this .exe at a later stage.
Please show me how to do that?



E:\>type killnote.bat
Code: [Select]@echo off

start notepad joe.txt

sleep 60

tasklist | findstr "%1" > notepid.txt


for /f "tokens=1,2 delims= " %%i in (notepid.txt) do (
echo PID=%%j

taskkill /pid %%j

)
OUTPUT:

E:\>killnote.bat note
pid=3056
SUCCESS: Sent TERMINATION signal to the process with PID 3056.

E:\>


Discussion

No Comment Found