WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Execute batch file plugin (if exist dir condition)
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1329237876

Message started by mkanet on Feb 14th, 2012 at 5:44pm

Title: Execute batch file plugin (if exist dir condition)
Post by mkanet on Feb 14th, 2012 at 5:44pm
Hi Gert, I think I might have made you mad by asking about two different problems in my previous previous forum post.  I hope you will forgive me.  :-[url]http://www.watchdirectory.net/cgi-bin/yabb2/YaBB.pl?num=1329140641/0[/url].  So... I made a separate forum post trying to figure out a way to handle this:

I have an existing WD task which executes a batch file as soon as an audio/video file is created or deleted using fast monitoring method.  How can I prevent this from happening if a *.tmp folder exists?   I swear, I tried to figure out how to do this based on your previous suggestion (in the above URL), however, I can't figure it out for this existing WD task.  I really appreciate your all your help.

Title: Re: Execute batch file plugin (if exist dir condit
Post by Gert on Feb 14th, 2012 at 6:02pm
Not mad, just a little tired.

People asking things. I create a script according to their wishes. Then they come with extra information (must remove directory immediately)... This happens sooooo often (on the forum and by email), it is sometimes a bit frustrating. There are days I just smile about it, today is not such a day.


Add this to the top of your current bat file:
[code]
rem check if there is a tmp folder somewhere below the monitored directory
DIR /s /ad "%WD_DIR%\*.tmp"
if %errorlevel% EQU 0 GOTO :EOF
[/code]

This checks if a *.tmp directory exists somewhere below the monitored directory (%WD_DIR%) and if it does (errorlevel = 0) quits the script (GOTO :EOF).

Title: Re: Execute batch file plugin (if exist dir condit
Post by mkanet on Feb 14th, 2012 at 6:39pm
Gert, you are a very good person.  You always help your users out; even the weirdest possible requests.  WD is such an amazing software; however, what makes it "extraordinary" is the support you offer to your users.  The best way I can show my appreciation is to tell others about your amazing software and to donate to a charity that needs help.  Thank you.

Title: Re: Execute batch file plugin (if exist dir condit
Post by Gert on Feb 15th, 2012 at 9:10am
Sorry for yesterday, I know you are a good guy.

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