Jump to content

Window 7 Combobox issues


Recommended Posts

Hello Autoit Community,

I'm running into an issue with working with Windows 7, combo boxes in group policy. I'm trying to enable various settings along with their additional Options: settings. This is where I'm running into the issue. For some reason I'm unable to access the combobox.

The following setting is located under:

Local Computer Policy\Computer Configuration\Administrative Templates\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Internet Zone

The following is just a small snippet of my code.

#RequireAdmin
WinWaitActive("Java permissions")
MsgBox(0, "", "I'm working")
Send("!e")
sleep(1000)
ControlCommand("", "", "WindowsForms10.COMBOBOX.app.0.378734a1", "SelectString", 'Disable Java')
;Send("OK")
;...followed by several similar commands

This worked fine while using Windows XP, but has been modified to work with Windows 7 and I havent been able to figure out how to make it work correctly.

Any help would be greatly appreciated.

Thanks

Link to comment
Share on other sites

Might be an UAC issue? Try again adding this line to the top of your script:

#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator

KaFu,

Thanks, for the suggestion. I gave this a try, unfortunately it doesn't seem like its working. I'm going to keep working on it.

It still successfully "Enables" the setting but still doesn't apply the "Options" setting.

Link to comment
Share on other sites

  • 2 weeks later...

Hello again AutoIt community,

I have added more to this code, now it successfully filters through the group policy editor, selects the requested setting, and then enables or disables the setting as required, however I'm still running in the same issue with not being able to select the appropriate "Options" settings?

Hopefully this new code makes it easier to see what I'm trying to do. Any help would be appreciated!

#RequireAdmin

_Expand("Internet Explorer|", "Internet Control Panel|", "Security Page|", "Internet Zone", "Local Group Policy Editor")
_GetItem("Java permissions", "!e", 'Disable Java', "Local Group Policy Editor")

;Function to expand to desired position within Group Policy Editor 
Func _Expand($subChild1, $subChild2, $subChild3, $subChild4, $groupPolicyWin)
Run("mmc.exe gpedit.msc")
WinWaitActive($groupPolicyWin)
ControlClick("", "", "AMCCustomTab1", "left", 1, 105, 7)

ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates")
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|")
    ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3 & $subChild4)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Select", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3 & $subChild4)

Sleep(500)
ControlClick("", "", "AMCCustomTab1", "left", 1, 105, 7)
Send("{tab}")

EndFunc

;Function to select required setting and then Enable/Disable that setting depending on requirement
;In this sample code I can successfully Enable the setting but am unable to set the "Options" setting that 
;should be set to 'Disable Java' or other setting as required
Func _GetItem($item, $setting, $setting2, $groupPolicyWin)
    Local $itemNum
    $itemNum = ControlListView($groupPolicyWin, "", "SysListView321", "FindItem", $item)
If $itemNum > -1 Then
        ControlListView($groupPolicyWin, "", "SysListView321", "Select", $itemNum)
        sleep(500)
        Send("{Enter}")
        WinWaitActive($item)
        sleep(500)
        Send($setting)
        sleep(1000)
        ControlCommand("", "", "WindowsForms10.COMBOBOX.app.0.378734a1", "SelectString", $setting2)
Else
        MsgBox(0, "Error", "Could not find this setting" & $item)
EndIf
EndFunc

Trying to run this on Windows 7, 32bit.

Thanks

Link to comment
Share on other sites

  • 1 month later...

Hello again AutoIt community,

I have added more to this code, now it successfully filters through the group policy editor, selects the requested setting, and then enables or disables the setting as required, however I'm still running in the same issue with not being able to select the appropriate "Options" settings?

Hopefully this new code makes it easier to see what I'm trying to do. Any help would be appreciated!

#RequireAdmin

_Expand("Internet Explorer|", "Internet Control Panel|", "Security Page|", "Internet Zone", "Local Group Policy Editor")
_GetItem("Java permissions", "!e", 'Disable Java', "Local Group Policy Editor")

;Function to expand to desired position within Group Policy Editor 
Func _Expand($subChild1, $subChild2, $subChild3, $subChild4, $groupPolicyWin)
Run("mmc.exe gpedit.msc")
WinWaitActive($groupPolicyWin)
ControlClick("", "", "AMCCustomTab1", "left", 1, 105, 7)

ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates")
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|")
    ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Expand", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3 & $subChild4)
ControlTreeView ($groupPolicyWin, "", "SysTreeView321", "Select", "Local Computer Policy|User Configuration|" & _
    "Administrative Templates|Windows Components|" &$subchild1 & $subChild2 & $subChild3 & $subChild4)

Sleep(500)
ControlClick("", "", "AMCCustomTab1", "left", 1, 105, 7)
Send("{tab}")

EndFunc

;Function to select required setting and then Enable/Disable that setting depending on requirement
;In this sample code I can successfully Enable the setting but am unable to set the "Options" setting that 
;should be set to 'Disable Java' or other setting as required
Func _GetItem($item, $setting, $setting2, $groupPolicyWin)
    Local $itemNum
    $itemNum = ControlListView($groupPolicyWin, "", "SysListView321", "FindItem", $item)
If $itemNum > -1 Then
        ControlListView($groupPolicyWin, "", "SysListView321", "Select", $itemNum)
        sleep(500)
        Send("{Enter}")
        WinWaitActive($item)
        sleep(500)
        Send($setting)
        sleep(1000)
        ControlCommand("", "", "WindowsForms10.COMBOBOX.app.0.378734a1", "SelectString", $setting2)
Else
        MsgBox(0, "Error", "Could not find this setting" & $item)
EndIf
EndFunc

Trying to run this on Windows 7, 32bit.

Thanks

I am having the same problem..ANy luck
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...