1.

Solve : Checking tasklist?

Answer»

BC_programmer...you are correct...initially I thought it was the BATCH file I had to find...

But after making more enquiries I found it was a .exe file I should be looking for (long story)...

So saster your code does find a .exe so please post the explorer.exe code you tried...

All the best Neilas easy as I can do

Code: [SELECT]echo off
set "process=explorer.exe"
:begin
tasklist | find "%process%" >nul && (echo run) || (echo dont run)
ping localhost -n 3 >nul
goto begin
replace explorer.exe for other process

when you learn more you understand my first code, with the same function

Hopefully this will answer my questions...

Thanks for all the help...

Have a GOOD weekend...

NeilHi Saster...

Tried what you suggested and it worked well...
I've CHANGED it slightly to suit my needs (I've replaced the :-

ECHO OFF
Title Daemon Check
set "process=ADMIN.exe"
:begin
CLS
tasklist | find "%process%" >nul && (echo admin is running) || (goto :Restart)
ping localhost -n 5 >nul
goto begin
:Restart
call D:\Neil\PDMS_apps\Restart_Daemon.bat
goto begin

Is what I have okay or does it break programming rules ?

Cheers
Neil



Discussion

No Comment Found