Sign in with
Sign up | Sign in
Your question
Closed

Need help with basic batch file

Last response: in Windows 7
Share
August 26, 2011 12:18:46 AM

Hello,
I just got a new PC that has Windows 7, am trying to make a batch file to back up "My Documents" to a thumbdrive the same way I did in XP but keep getting "Access Denied" message.

This line works fine- xcopy c:\"Users\John\Favorites" j:\ZT\"Users\John\Favorites"\ /e/s/d/y

but when I run- xcopy c:\"Users\John\My Documents" j:\ZT\"Users\John\My Documents"\ /e/s/d/y
I get "Access denied unable to create directory"


There is probably something simple that I'm missing but I don't see it.
Any help would be greatly appreciated.

Thanks,
John

More about : basic batch file

Best solution

a b $ Windows 7
August 26, 2011 12:33:56 AM

In windows 7 "My Documents" is renamed to "Documents"

so it would be C:\Users\John\Documents
Share
August 27, 2011 12:04:35 AM

Thanks! You are absolutely right, that works like a champ. I don't understand why I see both "Documents" & "My Documents" listed in Win 7 but that doesn't matter as long as I have my backup. Thanks again!
Score
0
Related resources
Can't find your answer ? Ask !
August 27, 2011 1:32:28 AM

Well in the first post you have the quote marks in the wrong place, should be in front of the c:, but actually the quotes aren't needed in your example.
Score
0
August 28, 2011 12:25:39 AM

Thanks for the input, it's working great now.
Score
0
a b $ Windows 7
August 29, 2011 10:59:52 PM

No problem! Glad I was able to help :) 
Score
0
September 6, 2011 1:13:59 PM

Best answer selected by John72ok.
Score
0
a c 403 $ Windows 7
October 18, 2011 12:21:11 AM

This topic has been closed by Area51reopened
Score
0
!