WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> Plugins >> BAT File question
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1140900635

Message started by hbreuer on Feb 25th, 2006 at 9:50pm

Title: BAT File question
Post by hbreuer on 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
Hans

Title: Re: BAT File question
Post by Gert on Feb 25th, 2006 at 11:18pm
Hans,

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.

Gert

WatchDirectory Forum » Powered by YaBB 2.5.2!
YaBB Forum Software © 2000-2017. All Rights Reserved.