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
Trying to kill a running task using watchDirectory (Read 3248 times)
wesman
Junior Member
**
Offline



Posts: 75
Australia
Trying to kill a running task using watchDirectory
Nov 12th, 2012 at 1:34am
 
Hi Gert

I have been trying to set up a task that runs a bat file on a file event.

The batch file is very simple - it kills a running Windows process - and it runs fine when I click on it in Windows. However, when watchDirectory runs it, nothing happens (ie the processed is not killed)

In the WD task, I have tried unchecking "Hide the run window" on the How to Run page, but still nothing happens. The History for the task shows that WD detects the file event and it says that WD has run the task, but the process is not killed.

The bat script I am trying to run is as follows:

@echo off
taskkill /im "wlmail.exe"
exit

Please can you tell me what I am doing wrong and how to get this to work?


Thanks

Wes Swindale
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2233
The Netherlands
Re: Trying to kill a running task using watchDirec
Reply #1 - Nov 12th, 2012 at 6:36am
 
Hello Wes,

Make sure to enable the option "capture bat file output" (or similar wording). Edit your bat file and remove the "echo off".
Now run the task. After it has failed to kill your process, select the menu "Explore Task Directory" (Win Explorer opens), navigate to the sub-directory with the name of your task. There you will find one or more files with names like output999999_99999.log. The most recent of those has the output (error messages?) of your bat file.
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
 
wesman
Junior Member
**
Offline



Posts: 75
Australia
Re: Trying to kill a running task using watchDirec
Reply #2 - Nov 12th, 2012 at 6:48am
 
Hi Gert

I have checked and inside this particular subfolder there are no currently updated output log files. The most recently updated on in there is from 8 hours ago. I have stopped and restarted the WD task but it doesn't make any difference.

What else can I try?


Thanks


Wes
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2233
The Netherlands
Re: Trying to kill a running task using watchDirec
Reply #3 - Nov 12th, 2012 at 6:55am
 
If there is no new log, WD didnt detect a file (and thus didnt start your bat) OR your bat file "hangs" somewhere.
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
 
Gert
YaBB Administrator
*****
Offline



Posts: 2233
The Netherlands
Re: Trying to kill a running task using watchDirec
Reply #4 - Nov 12th, 2012 at 6:56am
 
Try to start the task as a normal program (NOT as a Windows Service) so you will see the script output
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
 
wesman
Junior Member
**
Offline



Posts: 75
Australia
Re: Trying to kill a running task using watchDirec
Reply #5 - Nov 12th, 2012 at 6:58am
 
Ok thanks Gert - I will do that now. I should be able to work it out from here.

Thanks


Wes
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1