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\
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. Of course, this is just an example.
At the command prompt type in: xcopy /h
this will list all the available parameters it can use.
Basically you're missing one of the following:
Edit: Oops just noticed you're already using /e /s.
Yeah t's a bit tricky. This command will copy *.* from a folder I right-click on including subdirectories but it will not create the main directory; the "docs folder does not get created upon backup, just everything inside the folder.