Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Maybe a noob question, but how ALCs are determined on new created files (by running MyApp.exe)? I'd like to grant "users" full control on new files created inside C:\ProgramData\MyApp when launching myapp.exe. However this is not working:

icacls "%ProgramData%\MyApp" /grant "Users":(OI)(CI)F
echo "" >> "%ProgramData%\MyApp\test.txt"

test.txt of course has right permissions (full control by users group). However when i run MyApp.exe it creates a tons of files in "%ProgramData%\MyApp" but without any ACLs information.

Where i'm wrong? Thanks a lot.

share|improve this question
add comment

2 Answers 2

up vote 1 down vote accepted

The CreateFile() Win32 API allows specifying a custom security descriptor to be applied for new files. It could be that the author of MyApp, instead of using NULL, specified a valid but empty descriptor, resulting in the lack of ACLs.

share|improve this answer
add comment

Usually permissions are inherited from the parent folder. So you should first make sure that the folder which contains your files has the appropriate permissions and supports permission inheritance.

If this doesn't help, most likely you will need to set file permissions for each file your application creates. For this you should use code in your application instead of an external tool.

share|improve this answer
add comment

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.