Jump to content

Recommended Posts

Posted

I would like to use a Variable in a CACLS (For changing file permissions) statement rather than typing the directory in.

$varname="c:\mydir"

RunWait(@ComSpec & ' /c CACLS $varname, /E /C /R "System"','',@sw_hide)

Just want to do this if possible for ease of reading the script as most of the rest of the script uses the variable name instead of the full path and it would make it easier to change the path in the future.

Any one know how to do it or if its possible...

Posted

RunWait(@ComSpec & ' /c CACLS ' & $varname & ', /E /C /R "System"','',@sw_hide)

Cheerz Richard,

I had to remove the comma just before the (/E) to get it to remove "System" from the permissions.

.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...