How to change filename of file copied in xcopy batch file? - TechRepublic
Question
April 13, 2011 at 06:34 AM
dale27

How to change filename of file copied in xcopy batch file?

by dale27 . Updated 15 years, 2 months ago

I am currently using a batch file that uses the following code

@ECHO off
XCOPY /y C:\ProCal\Certificates\ProResDB.mdb H:\onsite\Imports\
@ECHO on

to copy one file (ProResDB.mdb) from the folder ‘C:\ProCal\Certificates\’ to a the folder ‘H:\onsite\Imports\’. How can I add the current date and a predefined initial to the filename of the copied file?
Example: ProResDBddmmyyXX.mdb

Alternatively if this can be done in VBScript, feel free to offer suggestions of how to script that.

This discussion is locked

All Comments