WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> Question regarding "Start .bat files" plugin
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1215431107

Message started by KRKA01 on Jul 7th, 2008 at 1:45pm

Title: Question regarding "Start .bat files" plugin
Post by KRKA01 on Jul 7th, 2008 at 1:45pm
Hi,

I have watchDirectory Professional and monitor a directory to use the "Start .bat files" plugin. I run this as a windows services.
If i stop the services and there a currently an active .bat file running, do watchdirectory terminate the acative .bat file instantly or will watchdirectory let the active .bat file run to the end?

Thanks

Krister  

Title: Re: Question regarding "Start .bat files" plugin
Post by Gert on Jul 7th, 2008 at 2:18pm
Hello Krister,

The bat file will not be terminated, but run until completion.

Gert

Title: Re: Question regarding "Start .bat files" plugin
Post by KRKA01 on Jul 7th, 2008 at 2:35pm
Thats great news, thanks for the quick reply.

Another thing, is it possible to have some sort of validation script, that only runs one time when i start the services for the "start .bat files" plugin, there i can check if my enviroment is ready, check for neccesary programs and folders etc? If the enviroment is not reday, do not start the service.  I know i can add this to the bat file i kick off every time a new files arrives, but i only want to check this when i start the service?

Many thanks

Krister
 

Title: Re: Question regarding "Start .bat files" plugin
Post by Gert on Jul 7th, 2008 at 2:43pm
Not really, but it is perhaps a good idea to implement something for it.

Currently, one of the environment variables that is set is WD_CUREVT (see http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBatEnv.html ) that will have a unique number for the current event. Perhaps we can add a new variable, for example WD_EVENTNO, that will have the "event number" for the current run, so the very first event (detected file) will set this variable to 1.

That way, you can do something like the following in your script:

[code]IF %WD_EVENTNO% EQU 1 Call "C:\MyScripts\FirstCall.bat"[/code]

The next release of WD will be somehwere later this week.

Gert

Title: Re: Question regarding "Start .bat files" plugin
Post by KRKA01 on Jul 7th, 2008 at 2:48pm
Ok, thanks for the info and quick reply

Krister

Title: Re: Question regarding "Start .bat files" plugin
Post by KRKA01 on Jul 14th, 2008 at 10:47am
Hi,

I noticed that you was able to implement the %WD_EVENTNO% variable in the 4.5.4 version.
Great work. Thanks.

Krister


Title: Re: Question regarding "Start .bat files" plugin
Post by Gert on Jul 14th, 2008 at 12:22pm
Hi Krister,

Yes we added that variable. Normally I post a message on the forum about new releases, but I forgot to do so yesterday.

Gert

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