boyemillar Posted July 28, 2008 Posted July 28, 2008 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...
Richard Robertson Posted July 28, 2008 Posted July 28, 2008 RunWait(@ComSpec & ' /c CACLS ' & $varname & ', /E /C /R "System"','',@sw_hide)
boyemillar Posted July 28, 2008 Author Posted July 28, 2008 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..
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now