Jump to content
Sign in to follow this  
kput

Cant control windows 7 button

Recommended Posts

kput

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.

Posted Image

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

EndFunc

And here is the window/button info:

>>>> Window <<<<

Title: Advanced Security Settings for Windows

Class: #32770

Position: 566, 357

Size: 636, 482

Style: 0x94C800CC

ExStyle: 0x00010101

Handle: 0x0000000000010322

>>>> Control <<<<

Class: Button

Instance: 6

ClassnameNN: Button6

Name:

Advanced (Class): [CLASS:Button; INSTANCE:6]

ID: 2006

Text: &Include inheritable auditing entries from this object's parent

Position: 21, 312

Size: 579, 13

ControlClick Coords: 7, 8

Style: 0x50012C03

ExStyle: 0x00000004

Handle: 0x0000000000010352

>>>> Mouse <<<<

Position: 602, 707

Cursor ID: 0

Color: 0x6173A4

>>>> StatusBar <<<<

>>>> ToolsBar <<<<

>>>> Visible Text <<<<

Auditing

To view or edit details for an auditing entry, select the entry and then click Edit.

Object name:

C:\Windows

Auditing en&tries:

A&dd...

&Edit...

&Remove

&Include inheritable auditing entries from this object's parent

Re&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>

OK

Cancel

Share this post


Link to post
Share on other sites
kput

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

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

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
Sign in to follow this  

×