WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> watching multiple directories on different drives
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1090164849

Message started by daved on Jul 18th, 2004 at 11:34pm

Title: watching multiple directories on different drives
Post by daved on Jul 18th, 2004 at 11:34pm
Gert,
 Is it possible to have watchDirectory watch multiple directories on different drives?  For example, I would like to watch a directory on drive c:, d:, and e: and add all changes in certain directories on those drive to a master zip archive on drive g:.  Is it a matter of just starting up however many instances of watchDirectory?  Is this feature not available on the evaluation version of watchDirectory?  Please let me know as this is very important in my evaluation.

Thanks again,
Dave

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 19th, 2004 at 12:31am
You should start multiple WD's for that. The .bat files them self are independent of the monitored directory,
so you can use the same .bat file for multiple WD's running.


Quote:
... master zip archive on g:...

You want them all to be stored in the same .zip??
Could get tricky with multiple WD's running (2 new files arriving at once, 2 wzzip.exe trying to update the same .zip at the same time).


If you need any 'fine tuning' of the .bat file, send me the exact requirements  (support (at) gdps.dk),
and I will happily do that for you.

Gert

Title: Re: watching multiple directories on different dri
Post by daved on Jul 19th, 2004 at 4:41am
Gert,
 In my master batch file, what parameters do I need to add the the watchDirectory.exe calls?

I am a little uncertain of this portion of the file.  Are there any examples anywhere...forgive me if there are.

Thanks again,

Dave

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 19th, 2004 at 11:36am

wrote on Jul 19th, 2004 at 4:41am:
Gert,
 In my master batch file, what parameters do I need to add the the watchDirectory.exe calls?

I am not sure what you mean, sorry.
Do you have a .bat file that starts several WD's (1 for each drive)?
Then you probably need to prefix the watchDirectory commands with "start /min", like:
[code]
start /min "c:\program files\gdp software\watchDirectory\watchDirectory.exe c:\dir1towatch c:\bin\wdbatfile.bat
start /min "c:\program files\gdp software\watchDirectory\watchDirectory.exe d:\dir1towatch c:\bin\wdbatfile.bat
start /min "c:\program files\gdp software\watchDirectory\watchDirectory.exe e:\dir1towatch c:\bin\wdbatfile.bat
[/code]
Otherwise the .bat file will wait for the first watchDirectory to exit before starting the next.

Is this what you mean?
Gert

Title: Re: watching multiple directories on different dri
Post by daved on Jul 20th, 2004 at 7:43am
yes.  I didn't know about the /min.  Thanks, I'll try that.

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 20th, 2004 at 12:44pm
Also, a small trick to get a valid watchDirectory command line:
1. Configure watchDirectory using the GUI (watchDirectoryStart)
2. Run (to make sure you have it setup correctly)
3. Press CTRL+F5 on the GUI
This copies the complete command line to the windows clipboard, ready to paste into your .bat file.

Gert

Title: Re: watching multiple directories on different dri
Post by daved on Jul 22nd, 2004 at 11:36am
I am still having a bit of an issue:

start /min "c:\program files\gdp software\watchDirectory\watchDirectory.exe c:\dir1towatch c:\bin\wdbatfile.bat

in the above command, is there anyway I can reference c:\dir1towatch within the c:\bin\wdbatfile.bat (ie.  is there an environment variable which holds that info? just as %WD_RELDIR% holds directory info?  I need the entire path c:\dir1towatch.)

Can I use %1 or %2 or something like that?  I'm not sure how I can access these arguments in the batch file.

Thanks again for your help,

Dave

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 22nd, 2004 at 12:01pm
All environment variables are described in the online help (see "writing bat files"), and also here:
http://www.gdps.dk/products/watchDir/help/bat.html.

Directory related environment variables are:
%WD_DIR% -  the directory that is watched (guess you want this).
%WD_FILE_D% - the directory of the new/changed/deleted file.

Gert

Title: Re: watching multiple directories on different dri
Post by daved on Jul 23rd, 2004 at 9:08am
Gert,
 I am still having some problems....

I tried making a master batch file by using the Ctrl-F5 technique you showed me  ;D and now I get the following when I try to run it:

Invalid switch - "/s".

Here is the contents of my master batch file:
@echo off
:: This file is called to begin watching all archivable directories
:: It monitors and adds new/changed files to a corresponding zip file
:: The prefix of the zip file is determined by which line the watched directory is on below

start /min "C:\Program Files\WatchDirectory\watchDirectory.exe" /s /xO /f /fast /RETRY10 /4 /i /h /v "C:\wedding contacts" "C:\Program Files\WatchDirectory\edited batch\WDAutoWinZip.bat"
start /min "C:\Program Files\WatchDirectory\watchDirectory.exe" /s /xO /f /fast /RETRY10 /4 /i /h /v "C:\Program Files\Microsoft Office\Templates" "C:\Program Files\WatchDirectory\edited batch\WDAutoWinZip.bat"
start /min "C:\Program Files\WatchDirectory\watchDirectory.exe" /s /xO /f /fast /RETRY10 /4 /i /h /v C:\Zips "C:\Program Files\WatchDirectory\edited batch\WDAutoWinZip.bat"

Thanks for all your help so far,

Dave

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 23rd, 2004 at 12:21pm
Hi Dave,

That is not watchDirectory complaining, but the start command.
It will use the first quoted string it sees as the window title for the new process.
If you change your commands to something like this:
[code]
start "watchDirectory" /min "c:\program files\gdp software....
[/code]
it should be ok. Now, start will use "watchDirectory" instead of the WD command line as the window title.

Gert

Title: Re: watching multiple directories on different dri
Post by daved on Jul 30th, 2004 at 11:28am
Gert,

Thanks again for all your help!!

My boss has unfortunately put this project on hold....stupid office politics!!  I am sure I will be looking at this again in a few months.  I have to say, I am very surprised how well the product works!

Thanks again Gert for all your help...!!  I'll probably be messaging you again when the project resumes! Take care!

Dave

Title: Re: watching multiple directories on different dri
Post by Gert on Jul 30th, 2004 at 11:46am
No problem, Dave.
Have a look here http://www.dilbert.com/comics/dilbert/archive/images/dilbert2004261480729.gif to brighten up your day.

Gert

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