CACLS questions "Y/N" while changing permissions
Use the echo command to pipe the character Y as input to the "ARE YOU SURE? Y/N" prompt.
Example:
dos echo y| cacls filename /g username:permission
MS KB: http://support.microsoft.com/kb/q135268/
CACLS runs but nothing happens
If you have a non-English OS, make sure that you pipe the "yes" character in the correct language.
French - "oui" - "dos echo o| cacls..."
Swedish - "ja" - "dos echo j| cacls..."
etc.
Also, try to remove the "echo y|" part from the command while looking for errors - without the pipe SetupBatcher will give more feedback from the cacls command in the log window.
CACLS returns an error
Sometimes - when creating accounts and setting permissions in the same batch job - the system does not recognize the user account since the account was created only seconds or less earlier.
Solution: insert a delay command before the CACLS command.
Example:
delay 3000
dos echo y| cacls filename /g username:permission
CACLS says "The argument string passed to DosExecPgm is not correct."
This happens when there is a space character in the user or group name.
Solution: put quotes around names containing a space.
Example:
DOS echo y| cacls %HomeRoot%\%username% /G %username%:F "Domain Admins":F