WatchDirectory home page
WatchDirectory Startseite (Deutsche Version)
Site WatchDirectory (Français)
  Welcome, Guest. Please Login or Register
YaBB - Yet another Bulletin Board
Page Index Toggle Pages: 1
BAT File question (Read 2711 times)
YaBB Newbies

Posts: 11
Palma de Mallorca
BAT File question
Feb 25th, 2006 at 9:50pm
Hallo Gert,

sorry being a pain in the neck... but my knowledge of DOS BAT files is nearly 0...

You gave me the key to add some text in the file I monitored with your application. Only one thing more: I add the text before the file. And its always the same text, so I have created a .txt file including it.

The problem is that the result file (merging both messages) gets the name from the first file (my .txt file), so it does not work.

Is it anyway to tell the BAT file I want to merge those files, but use for the merged file the name of the second file (ie: the file  %WD_FILE%)

Thank you very much again.

Best Regards
Back to top
IP Logged
YaBB Administrator

Posts: 2259
The Netherlands
Re: BAT File question
Reply #1 - Feb 25th, 2006 at 11:18pm

Just add the filename to the target directory:

COPY "C:\Texts\Header.txt" + "%WD_FILE%" "D:\TargetDirectory\%WD_FILE_N%"

WD_FILE contains the complete path of the new file (C:\MonitoredDir\Subdir\newfile.txt), WD_FILE_N contains just the filename (newfile.txt).

See this page for all variables you can use.

Back to top

Gert Rijs - gert (at) gdpsoftware (dot) com
End Alzheimer's:
WWW WWW GdPSoftware  
IP Logged
Page Index Toggle Pages: 1