WatchDirectory Forum
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl
watchDirectory forums >> How to... >> test for path substring?
http://www.watchdirectory.net/cgi-bin/yabb25/YaBB.pl?num=1123346898

Message started by kenwshmt on Aug 6th, 2005 at 6:48pm

Title: test for path substring?
Post by kenwshmt on Aug 6th, 2005 at 6:48pm
I have a batch file process a directory, moving the files to another outside directory.

I need to do aditional processing on the files, but not have them where they started from, but having them outside the watch path i would have to run a different batch file.

I want to put it into the same watch directory in a subfolder, but the opperations that have already been run, dont need to be rerun on several types of files.

How can i test d:\watch\2\done for d:\watch\2\ and either perform or not if that is part of the path?

there are far to many substring paths to do it manually.


Title: Re: test for path substring?
Post by Gert on Aug 7th, 2005 at 9:08pm
Did you look at the matches option of gdPUtil (http://www.watchdirectory.net/watchDir/GdPUtil.html)?

It lets you check for dos wildcards, like:
gdputil -matches "%WD_FILE%" "*\watch\?\*"
if %ERRORLEVEL% == 1 (ECHO MATCH) else (ECHO NOMATCH)

So, inside your .bat you could do
[code]
gdputil -matches "%WD_FILE%" "*\done\*"
if %errorlevel 1 goto :matchesTheDoneDirectory

.. here is doesn't match the "done" directory..
[/code]

Gert

Title: Re: test for path substring?
Post by kenwshmt on Aug 7th, 2005 at 10:29pm
I found another way using xxcopy, moving back the file types that are to be reprocessed.

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