boyemillar Posted July 28, 2008 Share 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... Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 28, 2008 Share Posted July 28, 2008 RunWait(@ComSpec & ' /c CACLS ' & $varname & ', /E /C /R "System"','',@sw_hide) Link to comment Share on other sites More sharing options...
boyemillar Posted July 28, 2008 Author Share 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.. Link to comment Share on other sites More sharing options...
Richard Robertson Posted July 29, 2008 Share Posted July 29, 2008 I simply edited the line you provided. Link to comment Share on other sites More sharing options...
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