armyman Posted April 9, 2011 Share Posted April 9, 2011 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 More sharing options...
armyman Posted April 12, 2011 Author Share Posted April 12, 2011 Sorry to bump this but this is the only thing that is holding my script up. Once I figure this out I'll be able to move into the actual testing phase. Thanks again. Link to comment Share on other sites More sharing options...
KaFu Posted April 12, 2011 Share Posted April 12, 2011 Might be an UAC issue? Try again adding this line to the top of your script: #AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministrator OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
armyman Posted April 13, 2011 Author Share Posted April 13, 2011 Might be an UAC issue? Try again adding this line to the top of your script:#AutoIt3Wrapper_Res_requestedExecutionLevel=requireAdministratorKaFu,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 More sharing options...
armyman Posted April 28, 2011 Author Share Posted April 28, 2011 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! expandcollapse popup#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 More sharing options...
gigabyte Posted June 20, 2011 Share Posted June 20, 2011 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! expandcollapse popup#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 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