1.

Solve : how to know a particular process is running or not using ms dos?

Answer»

hi

i want to create a batch file such that if internet EXPLORER is running then close mozilla firefox...

here how can i handle using IF


pls explain


thank you
sir
You don't use an if. One technique is to get a list of all running processes and then determine if iexplore.exe is among them. If it is, then kill firefox.

Code: [Select]@echo off
tasklist | find /i "iexplore.exe" && taskkill /im firefox.exe

Good luck.

thanks for reply

but above command is running in dos but through notepad it is not running..

SHOWING error tasklist is not a INTERNAL external or BATCHFILE comand.

pls tell
thanksQuote from: amittripathi on September 16, 2011, 12:55:05 AM

but above command is running in dos but through notepad it is not running..

Please explain. It's probably too early for this stuff, but how do you run a PROGRAM through notepad?

Not all machines have tasklist installed so try to replace it with tlist:

Code: [Select]@echo off
tlist | find /i "iexplore.exe" && taskkill /im firefox.exe

If an error still occurs, you can download tasklist from here and use the original code posted.

Good luck.


Discussion

No Comment Found