Modify File Permissions With Startup Script
Posted on 2008-10-14
By way of a script, I need to create a couple of folders in the root of workstation C: drives, and then set the permissions so that Domain Users have Modify permissions. I need this to all happen on the first login.
I have written a startup script which succesfully creates the folders, but I can't set the permissions. I am using the following to set the permissions:
objShell.Run("%COMSPEC% /c cacls C:\<FOLDERNAME> /T /E /G BUILTIN\Users:C")
It's not working though. I am assuming it's a permissions problem with the computer account not being able to set the permissions. I know I can set the file permissions using a GPO, but I need this all to be on first login, and at the time of the GPO being processed the first time around, the folders won't exist for the permissions to be set (as the script hasn't yet ran) so I can't get this to work.
Does anyone have any suggestions on how I can allow the file permissions to be set during startup, immediately after they are created?