SetACL "gotcha"

I may well be teaching granny to suck eggs here but I have recently discovered that the painstakingly constructed work-around for a "gotcha" in SetACL was never required.

The "gotcha" in question is that a SetACL command which uses paths enclosed in quotes which also has a trailing backslash will fail. So, for example, this:

SETACL -on "C:\Program Files\test\" -ot file -actn ace -ace n:test;p:full

will fail. The problem is that most of us would pass in an MSI property as the object upon which SetACL should act and, as we know, properties which resolve to paths will have a trailing backslash. To add to the fun, most such paths will be beneath %ProgramFiles% and will thus contain a space.

To date, I have used a combination of Custom Actions which test for space and trailing backslash and act accordingly. All has been in vain. The simple expedient of "escaping" the trailing backslash with ANOTHER backslash solves the problem:

SETACL -on "C:\Program Files\test\\" -ot file -actn ace -ace n:test;p:full

KISS was hardly ever more appropriate.

0 Comments   [ + ] Show comments

Answers (0)

Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ