Link to home
Start Free TrialLog in
Avatar of TSUS MIS
TSUS MISFlag for United States of America

asked on

Using a batch file to copy files with a wildcard in the directory path

I am writing a batch file to copy all files ending in .log to another directory.
The issue is that in the middle of the path, the folder name can be different.
Example:
xcopy "C:\Jobs\P0026\VB\Logs" "\\networkpath"

or on another machine it could be:

xcopy "C:\Jobs\P0075\VB\Logs" "\\networkpath"

depending on which program is running.

I basically need to declare a wildcard or variable for the P00* folder.
ASKER CERTIFIED SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of TSUS MIS

ASKER

That worked perfectly!! Thank you so much!!