sedejong Posted October 22, 2009 Posted October 22, 2009 Good Afternoon All, I am very new to Autoit and so far love it! I am currently working on a project that creates a new folder in the root of C: and then needs to apply permissions to that folder. I need to create a new group on the computer and then add domain accounts to that group, then add that group to the permissions on the new folder. Can someone point me in the right direction? Example: Computer Management | Local Users and Groups | Groups Add New group called "LocalGroup1" and add the member "Domain\user" Create a new folder called "Autoit" on the all users desktop. Add "LocalGroup1" to the security of the new "Autoit" folder Thanks a million everyone
Raven1 Posted October 23, 2009 Posted October 23, 2009 Assuming Windows XP, you could use the following DOS commands using RunWait(@ComSpec & ...net localgrouphttp://technet.microsoft.com/en-us/library/bb490706.aspxThis will create the local group and add memberscaclshttp://technet.microsoft.com/en-us/library/bb490872.aspxThis will modify the folder permissionsTo create the folder you could use the AutoIt function DirCreate()Check the AutoIt help file for the correct syntax.
bo8ster Posted October 23, 2009 Posted October 23, 2009 I have something like this in a bat script formatting the L: drive. Raven1 is correct, if you want to add a group before hand run "net localgroup /add ...", assign that group permissions then assign permissions for the group. In this case the Users group I assign permissions to group is already created. cd diskpart /s InitSataDrive.inp Format L: /FS:NTFS /V:DiskName /Q /X /Y L: mkdir FooData cacls L:\FooData /E /G Users:C mkdir L:\FooData\_systemdata mkdir L:\FooData\Export mkdir L:\FooDemoData cacls L:\FooDemoData/E /G Users:C Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic]
sedejong Posted October 29, 2009 Author Posted October 29, 2009 Raven and bo8ster..... you guys are the BOMB! after a little playing around with cacls and net localgroup. I have the program working like a champ! Thanks a million
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