Question:
What won't this batch file copy? "Access is denied"?
nicholashcanale
2011-06-22 12:55:37 UTC
Trying to write a batch file that copies data from one location to another in Windows 7 using xcopy. Here is what I have:

xcopy c:\folder2\*.* /y /e

When I check the error, it says "access is denied". My local account is in the administrator's group and the files being copied are not protected (to my knowledge).

Can anyone assist please?

Most helpful lands the 10!
Three answers:
Aacini
2011-06-22 19:50:08 UTC
If you review the usage of XCOPY command (for example, via XCOPY /?) you get something like this:



XCOPY source destination



This means that if you want to copy all files in folder1 to folder2, the syntax is this:



XCOPY C:\FOLDER1\*.* C:\FOLDER2 /Y /E



On the other hand, this form: XCOPY < C:\FOLDER indicate to execute XCOPY and the data that it normally read from keyboard (?) take they from a DIRECTORY instead (!?). This operation cause the "Access is denied" message.



Regards...
?
2011-06-22 13:01:44 UTC
Try and run the file as administrator, meaning rightclick and "run as administrator".

Also, check if there is any files in the target directory named the same as the source files, if so, make shure that those files are not in use by other programs, this can cause a denied access error.



Good luck!
?
2011-06-22 12:57:55 UTC
Check any hidden files. I get this all the time with folders which contain images, and it's the thumbs.db file being used by windows and it won't let you copy.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...