Old 12-15-2003, 08:35 AM   #1
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default TaskIsRunning 1.0

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....
Attached Files
File Type: zip taskisrunning.zip (2.1 KB, 280 views)
FTPServerTools is offline   Reply With Quote
Old 12-15-2003, 09:14 AM   #2
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

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.
Mouton is offline   Reply With Quote
Old 12-15-2003, 10:27 AM   #3
FTPServerTools
Senior Member
FlashFXP Beta Tester
ioFTPD Scripter
 
Join Date: Sep 2002
Posts: 543
Default

Ah silly me I didnt use it.. Programmers tend to quickly build something instead of hunting for a tool hehe..
FTPServerTools is offline   Reply With Quote
Old 12-15-2003, 10:55 AM   #4
alturismo
Senior Member
FlashFXP Registered User
ioFTPD Foundation User
 
Join Date: Nov 2001
Posts: 265
Default

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
alturismo is offline   Reply With Quote
Old 02-29-2004, 05:32 AM   #5
wooolF[RM]
Senior Member
ioFTPD Foundation User
 
Join Date: Oct 2003
Posts: 411
Default

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
wooolF[RM] is offline   Reply With Quote
Old 02-29-2004, 06:00 AM   #6
Zer0Racer
Senior Member
ioFTPD Scripter
 
Join Date: Oct 2002
Posts: 703
Default

Quote:
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.
Zer0Racer is offline   Reply With Quote
Old 02-29-2004, 09:03 AM   #7
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

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
Mouton is offline   Reply With Quote
Old 02-29-2004, 11:34 AM   #8
epoke
Member
ioFTPD Foundation User
 
Join Date: Nov 2003
Posts: 60
Default

@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

@+
epoke is offline   Reply With Quote
Old 03-01-2004, 09:55 AM   #9
wooolF[RM]
Senior Member
ioFTPD Foundation User
 
Join Date: Oct 2003
Posts: 411
Default

thnx a lot epoke, will give it a try =)
wooolF[RM] is offline   Reply With Quote
Old 03-01-2004, 04:34 PM   #10
Bratell
Member
FlashFXP Registered User
 
Join Date: Feb 2003
Posts: 64
Default

My TaskIsRunning is always returning 0. I have a test.bat that looks like this:
Code:
@echo off
taskisrunning.exe eggdrop.exe 
if errorlevel 0 echo 0
if errorlevel 2 echo 2
if errorlevel 1 echo 1
and
Code:
C:\ioFTPD\Windrop\>test.bat
0
Running 2k Server. Is this a known issue?
Bratell is offline   Reply With Quote
Old 03-01-2004, 05:12 PM   #11
Mouton
Posse Member
Ultimate Scripter
ioFTPD Administrator
 
Join Date: Dec 2002
Posts: 1,956
Default

the errorlevel checks must be in order...

if errorlevel 2 echo 2
if errorlevel 1 echo 1
if errorlevel 0 echo 0
Mouton is offline   Reply With Quote
Old 03-02-2004, 08:37 AM   #12
Bratell
Member
FlashFXP Registered User
 
Join Date: Feb 2003
Posts: 64
Default

Quote:
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
Bratell is offline   Reply With Quote
Reply

Tags
ioftpd.exe, reply, running, start, taskisrunning

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 10:22 PM.

Parts of this site powered by vBulletin Mods & Addons from DragonByte Technologies Ltd. (Details)