WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Run Any BAT File not working
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1359970576

Message started by SwindonYid on Feb 4th, 2013 at 10:36am

Title: Run Any BAT File not working
Post by SwindonYid on Feb 4th, 2013 at 10:36am
Hi,

I am using Watch Directory to run a batch file when new files arrive in a directory, the watch directory task does not seem to see any new files hit the watched directory yet when I run the batch file on it's own it works fine.

any ideas?

Matt

Title: Re: Run Any BAT File not working
Post by Gert on Feb 4th, 2013 at 10:52am
Hello Matt,

A few things to try.
First: do NOT run the task as a Windows Service. Set it to run "normal". Does it work that way? See this blog how to let it run as a service again: http://blog-en.gdpsoftware.com/2010/04/watchdirectory-tasks-as-windows-service.html

The above fixes most issues.... however, if it is still not working, try this:
Replace your bat file with a really simple bat file that just writes a line to a log as "proof" it was called by WD. Something like
ECHO %WD_FILE% >> C:\Temp\logfile.txt

Does that work?

Title: Re: Run Any BAT File not working
Post by SwindonYid on Feb 4th, 2013 at 11:02am
Hi Gert,

the "run as a windows service" is greyed out so I cannot tick or untick this option. (currently showing as unticked)

I have tried changing the bat file to ECHO %WD_FILE% >> C:\Temp\logfile.txt but again, the task does not run....manually run then the logfile has Echo is on in it.

Title: Re: Run Any BAT File not working
Post by SwindonYid on Feb 4th, 2013 at 11:05am
I have just deleted and recreated the task, now if I drop a file into the watched directory I get.....

***ERROR*** TTC Error Code: 0
Description: The operation completed successfully.
. Caught unhandled exception, current event ignored.

Regards

Matt

Title: Re: Run Any BAT File not working
Post by Gert on Feb 4th, 2013 at 11:06am
Can you please enable "debug" for the task, then run it again. Create a backup and email it to me (see below for my email). This is all explained here: http://blog-en.gdpsoftware.com/2010/06/send-task-backup-to-support.html


Title: Re: Run Any BAT File not working
Post by SwindonYid on Feb 4th, 2013 at 11:20am
Hi Gert,

I have emailed you the zip file as requested.
Many thanks

Matt

Title: Re: Run Any BAT File not working
Post by SwindonYid on Feb 4th, 2013 at 5:05pm
Hi,

as an extra bit of information, the task appears to work fine if I have a copy of the files on my desktop that are being placed in the monitored folder on my D drive!!!

Strange unless I am missing something really obvious!!

:-?

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.