PDA

View Full Version : TaskIsRunning 1.0


FTPServerTools
12-15-2003, 08:35 AM
TaskIsRunning is a small app for checking if and how many times a task is running.
The reply will tell how many there are running but the return code will also tell it.
Thus it is easy to use in a batch file.
Example of use:
TaskIsRunning cmd.exe
Example Reply:
2 tasks running
Reply is then 2


batchfile use to start ioftpd.exe only once
@echo off
TaskIsRunning ioftpd.exe
if errorlevel 1 goto exitbatch
start c:\ioftpd\system\ioftpd.exe
:exitbatch


1.0.0: First release

With this you can for example easily start ioftpd once or eggdrop only once....

Mouton
12-15-2003, 09:14 AM
off the chart, pslist.exe, from the PSTools package, can also report is an app is running or not...

:checkrunning
pslist windrop > nul
if errorlevel 1 goto restart
echo Eggdrop already running...
goto end

Note: on the pslist line, don't use windrop.exe, just windrop, or whatever your .exe is named.

FTPServerTools
12-15-2003, 10:27 AM
Ah silly me I didnt use it.. Programmers tend to quickly build something instead of hunting for a tool hehe..

alturismo
12-15-2003, 10:55 AM
as for some reason pslist from pstools gives no respond

on my system

so im damn happy cause taskisrunning gives me an reply ;)

big thx ftpservertools ;)

wooolF[RM]
02-29-2004, 05:32 AM
can anyone pls post a bat they are using(?) for starting windrop everytime on user login? (pslist doesn't work for me either for soem odd reason)

Regards

Zer0Racer
02-29-2004, 06:00 AM
Originally posted by wooolF[RM]
can anyone pls post a bat they are using(?) ...

And make that the contents of bat-file pasted as text. Use vB Code "CODE" (# button). I'm not gonna bother approving tiny bat-file attachments that can be shown as txt. :rolleyes:

Mouton
02-29-2004, 09:03 AM
The .bat I pasted higher should work, since taskisrunning do the same as pslist.

FTPServerTools example should tell u exactly how to use it.

just use the default botchk.bat and use those examples higher to check if the eggdrop is running in the middle of botchk

epoke
02-29-2004, 11:34 AM
@echo off
set Systemroot=C:\WINNT
cd /D C:\WINNT\eggdrop
pslist egg > nul
if errorlevel 1 goto restart
echo Eggdrop already running...
goto end

:restart
CD /D C:\WINNT\eggdrop
start hide /r /n 'C:\WINNT\eggdrop\egg.exe -nt eggconf.conf''
echo BOT DOWN (RESTARTiNG iT)
:end
exit 0

wooolF[RM] i think you need set Systemroot=C:\WINNT for pslist to work

@+

wooolF[RM]
03-01-2004, 09:55 AM
thnx a lot epoke, will give it a try =)

Bratell
03-01-2004, 04:34 PM
My TaskIsRunning is always returning 0. I have a test.bat that looks like this:

@echo off
taskisrunning.exe eggdrop.exe
if errorlevel 0 echo 0
if errorlevel 2 echo 2
if errorlevel 1 echo 1

and

C:\ioFTPD\Windrop\>test.bat
0

Running 2k Server. Is this a known issue?

Mouton
03-01-2004, 05:12 PM
the errorlevel checks must be in order...

if errorlevel 2 echo 2
if errorlevel 1 echo 1
if errorlevel 0 echo 0

Bratell
03-02-2004, 08:37 AM
Originally posted by Mouton
the errorlevel checks must be in order...

if errorlevel 2 echo 2
if errorlevel 1 echo 1
if errorlevel 0 echo 0
Actually, they were at one point, and it still didn't work. I switched to pslist.exe and it worked perfectly. I talked to someone earlier who had the exact opposite problem and switched to taskisrunning.exe.

Well.. since botchk.bat works now, I'm not complaining anymore ;)