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
Copy only directory structure across (Read 2270 times)
zorba
YaBB Newbies
*
Offline



Posts: 5
Copy only directory structure across
Apr 4th, 2006 at 2:22am
 
I would like to know if it is possible to have watchDirectory copy only a directory structure across to a new location. Eg, Say  I have a directory structure c:\users\user1,c:\users\user2,c:\users\user3. I would like the subdirectories under Users to be automatically created under a new directory called c:\watch\user1,c:\watch\user2,c:\watch\user3. I would also like in the event a new folder was created in under c:\users for it to be create under c:\watch.

Thanks in advance
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2238
The Netherlands
Re: Copy only directory structure across
Reply #1 - Apr 4th, 2006 at 10:33am
 
Hi,

Your best bet would be to use the "auto run a .bat file" plugin, and let it start the following script for new directories:

Code:
if "%WD_RELDIR%" NEQ "" GOTO :NESTED
MKDIR "C:\watch\%WD_FILE_N%"
GOTO :EOF

:NESTED
MKDIR "C:\watch\%WD_RELDIR%"
MKDIR "C:\watch\%WD_RELDIR%\%WD_FILE_N%"
 



Use the "Fire FILENEW/DIRNEW events for all files at startup" option to make sure all directories are initially created.

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