WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
   
  HomeHelpSearchLoginRegister  
 
Page Index Toggle Pages: 1
check a task is running using command line (Read 1780 times)
idfk
YaBB Newbies
*
Offline



Posts: 12
Sydney - Australia
check a task is running using command line
Nov 18th, 2010 at 7:42am
 
Is there a way of checking that a task is running via command line. I have though that sending -start xxxx would return "This task is already running" or "Service Started", however if it is NOT running I do not want it to start until I perform some other actions outside WD.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2225
The Netherlands
Re: check a task is running using command line
Reply #1 - Nov 18th, 2010 at 7:52am
 
If the task is configured as a service, you can do something like this (untested) code to check the task "Hello":
Code:
NET START > "C:\Temp\AllServices.txt"
FINDSTR /C:"watchDirectory:Hello" "C:\Temp\AllServices.txt"
IF %errorlevel% equ 0 goto :TaskIsRunning

rem task is not running
...
 


Back to top
 

Gert Rijs - gert (at) gdpsoftware (dot) com
Blog: http://blog-en.gdpsoftware.com/
End Alzheimer's: http://www.alz.org&&...
WWW WWW GdPSoftware  
IP Logged
 
idfk
YaBB Newbies
*
Offline



Posts: 12
Sydney - Australia
Re: check a task is running using command line
Reply #2 - Nov 18th, 2010 at 10:55pm
 
Hi Gert

Thanks for the tip, this has helped me work something out Smiley
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1