Jump to content

Autoit and setacl


Recommended Posts

Hi All,

What I'm trying to do will probably be way easy, but I haven't figured it out.

I would like to have an Autoit script that creates a folder and sets the permissions on the folder. Basically take away inheritance while copying the settings that are already there and then adding everyone read.

Here's what I've got:

DirCreate ("D:\Users")

;Run ('\\mavts003\software$\software\setacl\SetACL.exe -on "D:\Users" -ot file -actn setprot -op "dacl:p_c;sacl:nc" -rec no')

Run ('\\mavts003\software$\software\setacl\SetACL.exe -on "D:\Users" -ot file -actn ace -ace "n:Authenticated Users;m:revoke" -ace "n:everyone;p:read"')

Filecopy ("C:\Users\*.*", "D:\Users\", 9)

I don't get any errors, but it doesn't do what I want. Can somebody please help?

thanks!

Link to comment
Share on other sites

Try this:

DirCreate ("D:\Users")
;Run ('\\mavts003\software$\software\setacl\SetACL.exe -on "D:\Users" -ot file -actn setprot -op "dacl:p_c;sacl:nc" -rec no')
Run ("cmd.exe /c " & "\\mavts003\software$\software\setacl\SetACL.exe -on " & "D:\Users " & "-ot file -actn ace -ace " & "n:Authenticated Users;m:revoke " & "-ace " & "n:everyone;p:read")
Filecopy ("C:\Users\*.*", "D:\Users\", 9)

I dont know right execution syntax from cli for SetACL.exe.

So if it didn`t worka please give me right execution syntax from cmd.exe for SetACL.exe

Is this right execution ?

\\mavts003\software$\software\setacl\SetACL.exe -on D:\Users -ot file -actn ace -ace n:Authenticated Users;m:revoke -ace n:everyone;p:read
[size="5"] [/size]
Link to comment
Share on other sites

Hi All,

What I'm trying to do will probably be way easy, but I haven't figured it out.

I would like to have an Autoit script that creates a folder and sets the permissions on the folder. Basically take away inheritance while copying the settings that are already there and then adding everyone read.

Here's what I've got:

DirCreate ("D:\Users")

;Run ('\\mavts003\software$\software\setacl\SetACL.exe -on "D:\Users" -ot file -actn setprot -op "dacl:p_c;sacl:nc" -rec no')

Run ('\\mavts003\software$\software\setacl\SetACL.exe -on "D:\Users" -ot file -actn ace -ace "n:Authenticated Users;m:revoke" -ace "n:everyone;p:read"')

Filecopy ("C:\Users\*.*", "D:\Users\", 9)

I don't get any errors, but it doesn't do what I want. Can somebody please help?

thanks!

The first Run() is commented out, so not an issue here?

Does the second one work if you copy/paste that directly to a command line console (without the outer single quotes), using the same account that the script runs under?

:(

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

Hi!

Thanks for the replies!! By running the cmd, I could see that the network drive wasn't being found. I copied setacl local and ran it local and it works! Now I'm just having problems with the syntax for setacl and removing the authenticated users. Thanks for the help!

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