Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a batch file that copies folder from a temp directory to a public internet directory. The problem is, once the file is copied, the IUSR account doesn't have read privileges to the file and I get a 500 error. I can manually set permissions after upload, but is there an automatic way to do this for any file that gets added to the folder?

share|improve this question

2 Answers 2

Microsoft has a paper called How permissions are handled when you copy and move files and folders that you should find interesting.

An easy answer is to use xcopy.exe, instead of copy. Using (at least) the following command line option, the file ACL's will remain intact:

xcopy.exe source destination /O
share|improve this answer

Got it solved. I added IUSR permissions to the windows/temp directory and it is inheriting the right permissions now.

share|improve this answer
    
For completeness, the above can be achieved programatically using ICACLS.EXE. –  Simon Catlin Jul 31 '12 at 21:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.