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
WD_FILE_D not available when QUIET alert (Read 2910 times)
unixrulemas
YaBB Newbies
*
Offline



Posts: 3
WD_FILE_D not available when QUIET alert
Dec 1st, 2005 at 2:21pm
 
Hi guys,

I am new to the forum.

When monitoring a directory with hundreds of subfolders, is there a way to obtain WD_FILE_D environment variable?...i understand that this will not work since there is not file that trigger the alert, but i am looking for a way to perform QUIET monitoring on the main directory and use a variable to alert me of the specific folder. I do not want to create a task for every subfolder which is the only way i have seen it working.

Thanks.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: WD_FILE_D not available when QUIET alert
Reply #1 - Dec 1st, 2005 at 4:36pm
 
You will have to add a little trick inside your .bat script for that.
Let watchDirectory call this script:
Code:
rem call for the monitored directory itself
SET WD_FILE_D=%WD_DIR%
Call "C:\path to your real bat\file.bat"

rem call for all subdirectories
FOR /D %%I in ("%WD_DIR%\*.*") DO Call :NewSubDir "%%I"
GOTO :EOF

:NewSubDir
rem call for this subdirectory
SET WD_FILE_D=%1
Call "C:\path to your real bat\file.bat"
GOTO :EOF
 



The above will only call your .bat for directories directly below the monitored directory. Let me know if you need the sub-sub-sub-sub-directories as well.

Hope this helps.

Gert
[modified: typo in the code]
Back to top
« Last Edit: Dec 1st, 2005 at 6:09pm by Gert »  

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
 
unixrulemas
YaBB Newbies
*
Offline



Posts: 3
Re: WD_FILE_D not available when QUIET alert
Reply #2 - Dec 1st, 2005 at 9:27pm
 
Thank you...but it does not get me there. I was hoping to get alerts on the QUIET subfolder and not from the main one. I have a very simple eventcreate command which uses this variable value to send me alerts. I may just have to create events for each. Thank you very much for the help.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: WD_FILE_D not available when QUIET alert
Reply #3 - Dec 1st, 2005 at 9:48pm
 
I see, I misunderstood.
Sorry, that's not directly possible with WD.

Gert
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
 
Page Index Toggle Pages: 1