Jump to content

Set Folder Permissions


Recommended Posts

RunWait('CACLS c:\program files\{whatever} /E /T /C /G "Domain Users":F')

- or -

RunWait(@ComSpec & ' /c CACLS c:\program files\{whatever} /E /T /C /G "Domain Users":F')

Edited by weaponx
Link to comment
Share on other sites

RunWait('CACLS c:\program files\{whatever} /E /T /C /G "Domain Users":F')

- or -

RunWait(@ComSpec & ' /c CACLS c:\program files\{whatever} /E /T /C /G "Domain Users":F')

Tried both the above and it runs the CACLS command and the dos box runs very quickly and closes and looks like it is having a problem with the switch but most probably the "Domain Users":F part that is causing the problem and it doesnt set the permissions...

Link to comment
Share on other sites

You probably need double quotes around file path with spaces:

$result = RunWait('CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F')

MsgBox(0,"",$result)

- or -

$result = RunWait(@ComSpec & ' /c CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F')

MsgBox(0,"",$result)

Most command line programs return 1 for SUCCESS whereas Autoit functions return 0 for SUCCESS.

Link to comment
Share on other sites

You probably need double quotes around file path with spaces:

$result = RunWait('CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F')

MsgBox(0,"",$result)

- or -

$result = RunWait(@ComSpec & ' /c CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F')

MsgBox(0,"",$result)

Most command line programs return 1 for SUCCESS whereas Autoit functions return 0 for SUCCESS.

Cheerz

But, The above returns a result of 160

Link to comment
Share on other sites

  • Developers

RunWait(@ComSpec & ' /c CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F','',@sw_hide)

Is nicely explained in the Helpfile ... :D

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

RunWait(@ComSpec & ' /c CACLS "c:\program files\{whatever}" /E /T /C /G "Domain Users":F', @ScriptDir, @SW_HIDE)

Check out RunWait() in the help file.

EDIT: Milliseconds late.

Edited by weaponx
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...