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
delete sub directories (Read 5853 times)
jlucka
YaBB Newbies
*
Offline



Posts: 9
delete sub directories
Mar 10th, 2006 at 4:18pm
 
Hello,

my scanner send files in a sub directory.
I rename the files and send it in an other directory with watchdirectory but how can I delete the sub directory after that ?

Thanks for your answer
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: delete sub directories
Reply #1 - Mar 10th, 2006 at 5:55pm
 
Are you doing this from inside a .bat script? In that case you can do something like this:

rem do the rename and move to another directory
rem ....

rem now remove the original directory (will fail if not empty)
RD "%WD_FILE_D%"


WD_FILE_D contains the complete directory path of the file that triggered this script.

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



Posts: 9
Re: delete sub directories
Reply #2 - Mar 13th, 2006 at 9:09pm
 
hi Gert,

Thanks for your answer.

No I made that with the dynamic naming and the sequence function with a text file.

Can i do the same thing with a bat file?

thanks
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: delete sub directories
Reply #3 - Mar 14th, 2006 at 4:55am
 
It is probably easiest to create an additional task:

use the .bat file plugin to start "deletedirectory.bat"
let it only trigger for "DIRNEW - a new directory is created" on the events page
use the scheduler to delay this task for x minutes (so the copy/sort task had time to move the newly scanned file away)

Your .bat file (deletedirectory.bat) should be just this one line:
Code:
RD "%WD_FILE%"
 




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



Posts: 9
Re: delete sub directories
Reply #4 - Mar 14th, 2006 at 2:59pm
 
Hi,

Thanks it works but can i do all in the same bat file?

I must watch 20 directories and with this system i must create 40 services ( 3 mo of memory allocated in one service ). that's make too much.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: delete sub directories
Reply #5 - Mar 15th, 2006 at 1:40am
 
If all 20 directories have the same "root" (all below C:\Master) then you can create a single .bat file task to do it all.

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



Posts: 9
Re: delete sub directories
Reply #6 - Mar 15th, 2006 at 10:07am
 
yes, but the file sequence isn't the same and i must create for all user a single directory.
Back to top
 
 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2239
The Netherlands
Re: delete sub directories
Reply #7 - Mar 15th, 2006 at 5:20pm
 
Maybe you can combine those 20 "auto copy" tasks into one "Auto Sort" task. Each sort entry can have its own match pattern (*\user1\*.jpg) and dynamic name (including {sequence}). The only "problem" (maybe) is that all users need to have the same "root directory".
See for the sort plugin

Then you need 1 additional task to start a .bat file that removes the directories for all users.

Even if you keep using the 20 "auto copy tasks", you still need only 1 "remove directory" task, assuming the 20 directories share the same root directory.

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



Posts: 9
Re: delete sub directories
Reply #8 - Mar 16th, 2006 at 8:03pm
 
thanks

i will try that
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1