Jump to content

Use Variable in CACLS statement


Recommended Posts

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...

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...