robocopy append date to copied filename

Using RoboCopy, is there a way to append something to the copied filenames?
I want to set up a backup system where it will back up a specific file, and append the day of the month to it so that I'll always have a month's worth of backups. I can get the day of the month, but how can I append it with RoboCopy?
LVL 10
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Create destination directories for each day of the month:

Robocopy C:\Folder1 X:\Folder%THISDAY%

Open in new window

etech0Author Commented:
That would be very unwieldy. As it's only one file, I'd rather have them all in one folder. Do you know if that's possible?
etech0Author Commented:
Maybe I'm better off using XCopy?
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

If it's only one file, Xcopy may be better.
etech0Author Commented:
With Xcopy, can I specify the copied file's filename?

Windows 2000 and XP xcopy syntax

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/H] [/R] [/T] [/U]
[/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...]
source	Specifies the file(s) to copy.
destination	Specifies the location or name of new files.

Open in new window

etech0Author Commented:
When I run the batch file, it tells me:

Does C:\Users\me\Desktop\file2.txt specify a file name
or directory name on the target
(F = file, D = directory)?

Can I tell it from within the batch file that it will be a file? I want this to be able to run without user interaction required.
You may need to pre-create the directories.
Or do this:
XCOPY C:\Folder1\MyFile_%THISDAY%  X:\Folder2\
rem ---- Add a backslash here ---------------^

Open in new window

etech0Author Commented:
The directory is already there!

Here is my test code:

XCOPY C:\Users\me\Desktop\file.txt C:\Users\me\Desktop\file2.txt

Open in new window

Then just use "copy" (not xcopy).

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
etech0Author Commented:
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Shell Scripting

From novice to tech pro — start learning today.