Jump to content

how to set the NTFS rights using AUTOIT


Recommended Posts

Hello,

I am now trying to write a script to set NTFS rights automatically,any good man can tell me how I can

deal with it without using GUI?

thanks a lot!

Maybe not a good man, how about a semi-well behaved penguin?

Google up more information on the command line utility XACLS.EXE or you'll have to find the appropriate COM objects for filesystem management.

Hope that helps. :D

Edited by PsaltyDS
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

  • 5 years later...

Hi.

Was seaching for the same question, to be natively solved with autoit. Doesn't look like it's integrated with autoit, so I think I will go ahead using setacl.exe or setacl.ocx of Helge Klein.

Just to mention it, ven though it's a very old thread :)

Regards, Rudi.

Earth is flat, pigs can fly, and Nuclear Power is SAFE!

Link to comment
Share on other sites

  • Moderators

This is something I threw together for our helpdesk to run from their XP boxes. Might give you a starting point.

$var = InputBox("Grant Access", "Enter the user ID")
$dir = InputBox("Directory", "UNC path to parent directory")
$perm = InputBox("Level of Access", "Enter the level of Access: C(hange), F(ull control), R(ead only), W(rite)")

While 1

  $var2 = FileSelectFolder("Choose a folder.", $dir, 1)
        RunWait( 'CACLS "' & $var2 & '" /E /G ' & $var & ':' & $perm, "", @SW_HIDE )
        $var3 = MsgBox(4, "Complete", "Would you like to specify another directory?")
  If $var3 = 7 Then ExitLoop

WEnd

MsgBox(0, "Access Granted", "Access has been granted to the specified directories.")
Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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