Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

Backing up with batch


shadow31's Avatar
Member
0 0

Hi, I am making a program that I hope will back up some of my important document. I decided to use batch but I am having a problem. The program that is meant to back up everything from my documents on will only take the files within my documents and not any of the folders within it. This is the program that I used: and comments or reasons why this is happening would help..

xcopy "C:\documents and settings\%username%\my documents" "C:\documents and settings\%username%\hacked" pause cls pause


ynori7's Avatar
Future Emperor of Earth
0 0

it does the same thing on my computer too. same with just 'copy'. not sure why


ghost's Avatar
0 0

Try the /E switch after "xcopy".


shadow31's Avatar
Member
0 0

Thanks, I will try that. I. So I would make the program like this now:?

xcopy "C:\documents and settings\%username%\my documents" "C:\documents and settings\%username%\hacked" /E pause cls pause

Edited because I used google for a few minutes…


shadow31's Avatar
Member
0 0

GOT IT!!

it worked just fine now. I actually googled a little bit and found this site

http://commandwindows.com/xcopy.htm

it gives all the switches and tells you what they do. Thanks a lot for your help