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
Starting multiple .bat files (Read 4978 times)
matt555
YaBB Newbies
*
Offline



Posts: 2
Starting multiple .bat files
Nov 24th, 2008 at 11:35pm
 
Hopefully this has not been posted elsewhere, I searched for it quickly and did not see anything relevant to my inquiry.

I was curious if it is possible to run a new batch file once it is created within the specified directory. I have a web screen that give available folders containing zip files to process (checkboxes). Once decided upon, the user can select what directories they want to process and a batch file will be created for that specific folder to be processed. The problem is, that in order to prevent overwriting of files, they have an incremental number, as well as a timestamp on the end (for example: fire1-1227301458.bat). All the batch file contains is a simple php call that will run for the specific folder (they need to be run one at a time).

Thank you to anyone that can offer any help, I'm hoping that this program will offer us the solution that we are looking for.  Wink
Back to top
 

 
IP Logged
 
Gert
YaBB Administrator
*****
Offline



Posts: 2238
The Netherlands
Re: Starting multiple .bat files
Reply #1 - Nov 25th, 2008 at 7:05am
 
Hello Matt,

Yes, that should be possible.

* Use the "run a .bat file" plugin ( http://www.watchdirectory.net/wdhelp/plugins/wdopAutoRunBat.html ) and configure it to run the bat script below (startfire.bat)
* On the "events" page, only select the FILENEW event ( http://www.watchdirectory.net/wdhelp/help/wdnewconfigpage4.html )
* On the "filter events" page ( http://www.watchdirectory.net/wdhelp/help/filter_events.html ) create a filter so it will only start for your generated bat files,
 for example, create a filter "file name matches fire*.bat"


Here is the script. Save it somewhere on your C: drive as "startfire.bat"
Code:
rem make sure we are called for a batch script
IF "%WD_FILE_E%" NEQ "BAT" GOTO :EOF
rem call the batch script
CALL "%WD_FILE%"
rem if you want to delete the script once its ready, remove the REM on the next line
REM DEL "%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
 
matt555
YaBB Newbies
*
Offline



Posts: 2
Re: Starting multiple .bat files
Reply #2 - Nov 25th, 2008 at 4:31pm
 
Awesome!!! Thanks a million. You just saved me the biggest headache of having to look for a different solution.

Thanks Again!
Back to top
 
 
IP Logged
 
Page Index Toggle Pages: 1