kput 0 Posted October 14, 2012 I have read thru the entire WWW and cant seem to find out why I cant use ControlCommand to set the advanced security audit settings. I need to be able to uncheck one and check the other and verify if they are checked or not. I have tried this code and get 0 returned every time:Func DefaultAudit() WinActivate("Advanced Security Settings for Windows", "To view or edit details for an auditing entry, select the") WinWaitActive("Advanced Security Settings for Windows") $id = ControlGetHandle ( "Advanced Security Settings for Windows", "Include inheritable auditing entries from this object's parent", 2006 ) $id2 = ControlGetHandle ( "Advanced Security Settings for Windows", "all existing inheritable auditing entr", 2008 ) $state = ControlCommand("Advanced Security Settings for Windows", "Include inheritable auditing entries from this object's parent", 2006, "IsChecked") $text = ControlGetText ( "Advanced Security Settings for Windows", "" , 2006 ) if ControlCommand("Advanced Security Settings for Windows","","Button6","IsChecked") Then MsgBox(0,"","Checked") Else MsgBox(0,"","Not Checked " & @CR & $id & @CR & $id2 & @CR & $state & @CR & $text) EndIf EndFuncAnd here is the window/button info:>>>> Window <<<<Title: Advanced Security Settings for WindowsClass: #32770Position: 566, 357Size: 636, 482Style: 0x94C800CCExStyle: 0x00010101Handle: 0x0000000000010322>>>> Control <<<<Class: ButtonInstance: 6ClassnameNN: Button6Name: Advanced (Class): [CLASS:Button; INSTANCE:6]ID: 2006Text: &Include inheritable auditing entries from this object's parentPosition: 21, 312Size: 579, 13ControlClick Coords: 7, 8Style: 0x50012C03ExStyle: 0x00000004Handle: 0x0000000000010352>>>> Mouse <<<<Position: 602, 707Cursor ID: 0Color: 0x6173A4>>>> StatusBar <<<<>>>> ToolsBar <<<<>>>> Visible Text <<<<AuditingTo view or edit details for an auditing entry, select the entry and then click Edit.Object name:C:\WindowsAuditing en&tries:A&dd...&Edit...&Remove&Include inheritable auditing entries from this object's parentRe&place all existing inheritable auditing entries on all descendants with inheritable auditing entries from this object<A>What are the requirements for auditing object access?</A>OKCancel Share this post Link to post Share on other sites
kput 0 Posted October 14, 2012 Is there possibly another way to do this? I need it to work on multiple machines. Share this post Link to post Share on other sites
kput 0 Posted October 14, 2012 sometimes it is just as simple as running a program as administrator... Thanks for reading Share this post Link to post Share on other sites