PDA

View Full Version : Xcopy question


n8chavez
March 16th, 2007, 01:34 AM
I'm adding a backup option to my context menu. I want to make it so that whatever directory I'm in I can right-click on a file or folder and have it backed up to a certain location. This is the command I have so far:
{QUOTE-> xcopy /e /s /h /k /y %1 D:\Backups\ <-QUOTE}
My question is: How do I maintain the same directory structure? If I want to backup c:\docs how can I make sure that they are copied to d:Backups\docs? As it is right now the "docs" subdirectory does not get copied.

Any ideas?

Mrkvonic
March 16th, 2007, 06:37 PM
Hello,

Like this:
xcopy "C:\Docs\*.*" "D:\Backups\Docs\" /e

Mrk

n8chavez
March 16th, 2007, 07:32 PM
That was just an example. I want to be able to backup whatever folder I right-click on to a subdirectory with the same name in D:\Backups.

Mrkvonic
March 17th, 2007, 03:42 AM
Hello,
I did not give you an example - I gave you a working thingie.
I use the above (except docs) to copy files and folders from one comp to another, running as script.
Mrk