SamCobb Posted October 15, 2010 Share Posted October 15, 2010 I am trying to find a way to script a solution to resetting ownership on folder and their files/folders below in a Windows 2003 environment. I am surprised not to find some of this functionality in AutoIT. Thanks Link to comment Share on other sites More sharing options...
saywell Posted October 15, 2010 Share Posted October 15, 2010 Not my field, but does the stuff in Net Share management udf do what you want it to? William Link to comment Share on other sites More sharing options...
SamCobb Posted October 19, 2010 Author Share Posted October 19, 2010 Some but it's still very limited. Link to comment Share on other sites More sharing options...
Varian Posted October 19, 2010 Share Posted October 19, 2010 (edited) Search the forum for cacls(.exe) and you will find some help thereEDIT: You may also try xcacls as a search on the forumEDIT EDIT: Try this page "How to use Xcacls.vbs to modify NTFS permissions" Edited October 19, 2010 by Varian Link to comment Share on other sites More sharing options...
UEZ Posted October 19, 2010 Share Posted October 19, 2010 (edited) Try this (WMI version):;Coded by UEZ 2010 #RequireAdmin $objWMIService = ObjGet("winmgmts:{impersonationLevel = impersonate}!\\.\root\cimv2") $file = FileOpenDialog("Select file to reset ownership from current user.", "", "(*.*)") If @error Then Exit Set_OwnerShip($file) Func Set_OwnerShip($file) $file = StringReplace($file, "\", "\\") Local $colItems, $colItem $colItems = $objWMIService.ExecQuery("Select * From CIM_DataFile Where Name = '" & $file & "'", "WQL", 0x30) If IsObj($colItems) Then For $objItem In $colItems $objItem.TakeOwnerShipEx Next Return SetError(0) Else Return SetError(1) EndIf EndFuncBr,UEZ Edited October 20, 2010 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ 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