troubleshooting Question

XCopy folder from source to destination

Avatar of holemania
holemania asked on
Microsoft DOS
3 Comments1 Solution415 ViewsLast Modified:
Need help with a bat script to copy a folder from the C drive to another location on the C drive with the date.

Example:
Source - C:\Backup DB
Target - C:\Archive

I want to take the entire folder "C:\Backup DB" and put that into the C:\Archive with timestampe to the "Backup DB" folder.

The "Backup DB" gets updated with a new DB backup in there nightly.  I want to take the entire folder and just give it a date in the folder name.

Result:
C:\Archive\Backup DB 12-09-2011

Here's what I tried:

XCOPY "C:\Backup DB" "C:\Archive\Backup DB %DATE% %TIME%" /S /I

I'm not getting the date format I need and it's not copying the files inside of the folder "Backup DB".

ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros