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
Changes to folder path processing V3 to V4 (Read 3291 times)
Loz
YaBB Newbies
*
Offline



Posts: 6
Changes to folder path processing V3 to V4
Feb 24th, 2006 at 8:40pm
 
Hi Gert

I have upgraded to V4.042 pro from one of the V3's.

Under V4 the .bat I execute does not appear to 'run inside' the watched folder (or set the 'path').

I have an XSL file in the watched folder that references an image that is also in the watched folder.  With V4, i have to hardcode the full path for the image but in V3 it found it ok.  Do i have to change the .bat to set the path first?

Many thanks

Loz

Code from the .bat (the folder watched = targetdir below)

SET TARGETDIR=R:\RTAPRDPHIE\PH\Client_doc\Statement_valuations\held
SET TARGETDIR2=R:\RTAPRDPHIE\PH\Client_doc\Statement_valuations
SET XSL_EN=bde2200tEN.xsl

SET PDFTARGET=%TARGETDIR2%\%WD_FILE_B%.PDF
SET XSLFILE=%WD_FILE_D%\%XSL_EN%

c:\progra~1\altova\fop\fop -xsl "%XSLFILE%" -xml "%WD_FILE%" -pdf "%PDFTARGET%"




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



Posts: 2225
The Netherlands
Re: Changes to folder path processing V3 to V4
Reply #1 - Feb 25th, 2006 at 5:03am
 
Hi,

Version 3 set the working directory to the monitored directory, except when you monitor a network drive (then it is set to your Windows directory).
Like you found out, v4 is not consistent with its working directory. When you start the task from inside the WDCC the working dir will be quite random (depending on which directory you "browsed to" last). When starting a task as a service or the startup menu, it depends on your version of Windows where it will be.

If you want to change your working directory to the monitored directory inside the .bat file, add

CD "%WD_DIR%"

at the beginning of your script. If you want the current directory to be the directory where the new file is located, add

CD "%WD_FILE_D%"

instead.

I see this line inside your script
Code:
SET XSLFILE=%WD_FILE_D%\%XSL_EN%  


Note that WD_FILE_D always ends with a \ with WD4, so you may want to change that to
Code:
SET XSLFILE=%WD_FILE_D%%XSL_EN%  




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



Posts: 6
Re: Changes to folder path processing V3 to V4
Reply #2 - Feb 25th, 2006 at 3:51pm
 
many thanks Gert

Smiley

Loz
Back to top
 
 
IP Logged
 
Loz
YaBB Newbies
*
Offline



Posts: 6
Re: Changes to folder path processing V3 to V4
Reply #3 - Feb 25th, 2006 at 6:56pm
 
Gert

The solution didn't last long because I changed to run as a service...! (on windows 2003 server)

I added the following to the .bat:

CD "%WD_DIR%"

Running as a service I get "CMD does not support UNC paths as current directories." 

Any other suggestions?  (I am in the process of swapping over to use windows service as I now get logged off after 2 hours (out of my control) and when the server gets restarted no one logs onto it). 

thanks

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



Posts: 2225
The Netherlands
Re: Changes to folder path processing V3 to V4
Reply #4 - Feb 25th, 2006 at 11:14pm
 
On Windows XP and 2003 you can not make an UNC path the current directory (I believe Win2K allows it).
So, probably your best bet is to use complete path names (\\server\share\dir\file.txt) instead of relying on the file being inside the current 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
 
Page Index Toggle Pages: 1