gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 3 minutes ago, ioa747 said: expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y Global $sTestPath, $sTestItem $sTestPath = "\Computer Configuration\Administrative Templates\All Settings" $sTestItem = "Allow Adobe Flash" _Example10($sTestPath, $sTestItem) Func _Example10($sPolicyPath, $sPolicyItem) If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem ;Selects the first items. ControlListView($hGPO, "", $hListView, "Select", 0) ;Returns a string containing the item index of selected items $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) ;Returns the number of list items. $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") Sleep(50) ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) For $x = 0 To 9 ControlListView($hGPO, "", $hListView, "Select", $x) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") ConsoleWrite("$SelectedItem=" & $SelectedItem & " ") $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) Sleep(500) Next EndFunc ;==>_Example10 It's still the same you can see the spinner on the mouse https://usaupload.com/6UXn/aaa_(3).mp4 Maybe if I combine the search in code, it will load less, so I will only use the path if more than one result is found Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 try this expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y Global $sTestPath, $sTestItem $sTestPath = "\Computer Configuration\Administrative Templates\All Settings" $sTestItem = "Allow Adobe Flash" _Example10($sTestPath, $sTestItem) Func _Example10($sPolicyPath, $sPolicyItem) If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem ;Selects the first items. ControlListView($hGPO, "", $hListView, "Select", 0) ;Returns a string containing the item index of selected items $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) ;Returns the number of list items. $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") Sleep(50) ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) Sleep(350) For $x = 0 To 9 ControlListView($hGPO, "", $hListView, "Select", $x) Sleep(50) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & " ") $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) Sleep(300) Next EndFunc ;==>_Example10 I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 my console out: $hGPO=0x00000000000C02E0 $sPolicyPath=Local Computer Policy\Computer Configuration\Administrative Templates\All Settings $sPolicyItem=Allow Adobe Flash $tmpPath=Local Computer Policy $tmpPath=Local Computer Policy|Computer Configuration $tmpPath=Local Computer Policy|Computer Configuration|Administrative Templates $tmpPath=Local Computer Policy|Computer Configuration|Administrative Templates|All Settings $SelectedItem=0 $ItemTxt=\Windows Components\Delivery Optimization $ItemCnt=2536 $SelectedItem=0 $ItemTxt=\Windows Components\Delivery Optimization $SelectedItem=1 $ItemTxt=\Windows Components\Microsoft User Experience Virtualization\Applications $SelectedItem=2 $ItemTxt=\Windows Components\Microsoft User Experience Virtualization\Applications $SelectedItem=3 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Internet Zone $SelectedItem=4 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Intranet Zone $SelectedItem=5 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Local Machine Zone $SelectedItem=6 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Internet Zone $SelectedItem=7 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Intranet Zone $SelectedItem=8 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Local Machine Zone $SelectedItem=9 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Restricted Sites Zone I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 1 minute ago, ioa747 said: my console out: $hGPO=0x00000000000C02E0 $sPolicyPath=Local Computer Policy\Computer Configuration\Administrative Templates\All Settings $sPolicyItem=Allow Adobe Flash $tmpPath=Local Computer Policy $tmpPath=Local Computer Policy|Computer Configuration $tmpPath=Local Computer Policy|Computer Configuration|Administrative Templates $tmpPath=Local Computer Policy|Computer Configuration|Administrative Templates|All Settings $SelectedItem=0 $ItemTxt=\Windows Components\Delivery Optimization $ItemCnt=2536 $SelectedItem=0 $ItemTxt=\Windows Components\Delivery Optimization $SelectedItem=1 $ItemTxt=\Windows Components\Microsoft User Experience Virtualization\Applications $SelectedItem=2 $ItemTxt=\Windows Components\Microsoft User Experience Virtualization\Applications $SelectedItem=3 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Internet Zone $SelectedItem=4 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Intranet Zone $SelectedItem=5 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Local Machine Zone $SelectedItem=6 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Internet Zone $SelectedItem=7 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Intranet Zone $SelectedItem=8 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Local Machine Zone $SelectedItem=9 $ItemTxt=\Windows Components\Internet Explorer\Internet Control Panel\Security Page\Locked-Down Restricted Sites Zone my console you want we try to add the search Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 4 minutes ago, ioa747 said: try this expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y Global $sTestPath, $sTestItem $sTestPath = "\Computer Configuration\Administrative Templates\All Settings" $sTestItem = "Allow Adobe Flash" _Example10($sTestPath, $sTestItem) Func _Example10($sPolicyPath, $sPolicyItem) If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem ;Selects the first items. ControlListView($hGPO, "", $hListView, "Select", 0) ;Returns a string containing the item index of selected items $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) ;Returns the number of list items. $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") Sleep(50) ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) Sleep(350) For $x = 0 To 9 ControlListView($hGPO, "", $hListView, "Select", $x) Sleep(50) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & " ") $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) Sleep(300) Next EndFunc ;==>_Example10 ok if it on exe it is work but i didn't see the console. you can help me to add for code only if i have More than one result after searching calls the search function with ptah expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y #include <Constants.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> ;============================================================== ; FUNCTION: _Example ; DESCRIPTION: This function opens the Group Policy Object Editor, ; navigates to the specified policy setting, and changes its value ; to the specified setting. ; PARAMETERS: ; $metric - The name of the policy setting to be changed. ; $setting - The value to which the policy setting should be changed. ; RETURNS: None. ;============================================================== If Not $CmdLine[0] Then Exit Run(@AutoItExe & " " & @ScriptFullPath & " /Allow Adobe Flash /param2 disable") MsgBox(4096, "message", "The setting "& $CmdLine[1] & " set to " & $CmdLine[2] & " This box will time out in 3 seconds", 3) Sleep(5000) Local $mtric =$CmdLine[1] ; "Allow Adobe Flash" Local $setting = $CmdLine[2] ;"disable" _Example($mtric,$setting) MsgBox(4096, "Test", "The setting saved and set "& $mtric & " to " & $setting & " This box will time out in 3 seconds", 3) Exit(0) ; Finished! Func _selectDisEna($setting) Sleep(200) ; we give some time until the window appears Local $hGPOedit = WinWait("[CLASS:WindowsForms10.Window.8.app.0.297b065_r69_ad1]") ControlFocus($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad16") For $i = 5 To 1 Step -1 If $setting = "disable" Or $setting ="Disabled" Then ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad16", "d") Sleep(3000) ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad112", "a") EndIf If $setting = "enabled" Or $setting ="Enabled" Then ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad16", "e") Sleep(3000) ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad112", "a") EndIf If $setting = "not configured" Or $setting ="Not configured" Then Send("{c}") EndIf ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad112", "{p}") Next ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.297b065_r69_ad112", "{ENTER}") EndFunc Func _Example($mtric,$setting) ; Run gpedit.msc ; Run("c:\Windows\system32\mmc.exe c:\Windows\system32\gpedit.msc /a") ;Run("c:\Windows\system32\mmc.exe C:\Users\" & @USERNAME &"\Desktop\script\gpedit_v1.msc /a") Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") Sleep(2500) Local $hGPO = WinWait("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") Sleep(500) ControlSend($hGPO, "", $hTreeView_1, "{ALT}{A}{O}") ControlFocus($hGPO, "", "[TITLE:Filter Options]") WinWait("[TITLE:Filter Options]") Sleep(3500) If ControlCommand("Filter Options", "Enable &Keyword Filters", "Button2", "IsChecked", "") = 0 Then ControlSend("[TITLE:Filter Options]", "", "[CLASS:Edit; INSTANCE:1]", "{ALT down}{K}{F}{ALT up}") Else ControlSend("[TITLE:Filter Options]", "", "[CLASS:Edit; INSTANCE:1]", "{ALT down}{F}{ALT up}") EndIf Sleep(3500) ;;Type search ControlSend("[TITLE:Filter Options]", "", "[CLASS:Edit; INSTANCE:1]", $mtric) Sleep(3500) ControlSend("[TITLE:Filter Options]", "", "[CLASS:Edit; INSTANCE:1]", "{ENTER}") ControlFocus($hGPO, "", $hTreeView_1) ControlSend($hGPO, "", $hTreeView_1, "a") ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") ;~ Sleep(1000) Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ControlFocus($hGPO, "", $hListView) ControlSend($hGPO, "", $hListView, "{HOME}") Sleep(2000) ControlSend($hGPO, "", $hListView, "{down 5}") Sleep(2000) Local $Item, $ItemCnt, $ItemTxt, $FindItem $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) $FindItem = ControlListView($hGPO, "", $hListView, "FindItem", $mtric) ConsoleWrite("$FindItem=" & $FindItem & @CRLF) ControlListView($hGPO, "", $hListView, "Select", $FindItem) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) ControlSend($hGPO, "", $hListView, "{Enter}") Sleep(3500) _selectDisEna($setting) ;Send ("{Ctrl}{S}") ;Send("^s") ;_Validation($mtric,$setting) Sleep(3500) ControlFocus($hGPO, "", $hTreeView_1) ControlSend($hGPO, "", $hTreeView_1, "{ALT down}{F4}{ALT up}") Sleep(2000) Local $hGPO = WinWait("Microsoft Management Console") ControlSend($hGPO, "", "[CLASS:Static; INSTANCE:2]", "{N}") ;MsgBox(4096, "Test", "The setting saved and set "& $mtric & " to " & $setting & " This box will time out in 10 seconds", 10) EndFunc Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 2 minutes ago, gal9 said: ok if it on exe it is work but i didn't see the console. this is the console I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 (edited) 4 minutes ago, ioa747 said: this is the console yes but if i do compile script It doesn't close the GPO and it is run (If I run the exe). so if you can add in code the A search function get path and send enter if the same path and i call the function only if i have More than one result Edited March 22, 2023 by gal9 Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 (edited) the console we need it to see the results since everything is working (which now is not working) then we don't need it like here, for example, before it used to give us the $ItemCnt=2527, now it doesn't $ItemCnt=0 why? like ($SelectedItem=0 is ok) ($ItemTxt = is not ok) Maybe it needs more time? expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y Global $sTestPath, $sTestItem $sTestPath = "\Computer Configuration\Administrative Templates\All Settings" $sTestItem = "Allow Adobe Flash" _Example10($sTestPath, $sTestItem) Func _Example10($sPolicyPath, $sPolicyItem) If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem ;Selects the first items. ControlListView($hGPO, "", $hListView, "Select", 0) ;Returns a string containing the item index of selected items $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(250) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) ;Returns the number of list items. $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") Sleep(50) ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) Sleep(350) For $x = 0 To 9 ControlListView($hGPO, "", $hListView, "Select", $x) Sleep(50) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(150) ConsoleWrite("$SelectedItem=" & $SelectedItem & " ") $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) Sleep(300) Next EndFunc ;==>_Example10 Edited March 22, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 (edited) you need to see if the console is working on 64 or 32 bit to see this Open the Task Manager go Find the gpo console select it Right click go to where it says go to details and after you open the details tab You will go to the columns header right click and you will get Select columns and from there you will choose the platform Edited March 22, 2023 by ioa747 I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 6 minutes ago, ioa747 said: you need to see if the console is working on 64 or 32 bit to see this Open the Task Manager go Find the gpo console select it Right click go to where it says go to details and after you open the details tab You will go to the columns header right click and you will get Select columns and from there you will choose the platform select what? Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 platform I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 30 minutes ago, ioa747 said: the console we need it to see the results since everything is working (which now is not working) then we don't need it like here, for example, before it used to give us the $ItemCnt=2527, now it doesn't $ItemCnt=0 why? like ($SelectedItem=0 is ok) ($ItemTxt = is not ok) Maybe it needs more time? expandcollapse popup#RequireAdmin #AutoIt3Wrapper_UseX64=y Global $sTestPath, $sTestItem $sTestPath = "\Computer Configuration\Administrative Templates\All Settings" $sTestItem = "Allow Adobe Flash" _Example10($sTestPath, $sTestItem) Func _Example10($sPolicyPath, $sPolicyItem) If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Local $Item, $ItemCnt, $ItemTxt, $FindItem ;Selects the first items. ControlListView($hGPO, "", $hListView, "Select", 0) ;Returns a string containing the item index of selected items $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(50) ConsoleWrite("$SelectedItem=" & $SelectedItem & @CRLF) $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(250) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) ;Returns the number of list items. $ItemCnt = ControlListView($hGPO, "", $hListView, "GetItemCount") Sleep(50) ConsoleWrite("$ItemCnt=" & $ItemCnt & @CRLF) Sleep(350) For $x = 0 To 9 ControlListView($hGPO, "", $hListView, "Select", $x) Sleep(50) $SelectedItem = ControlListView($hGPO, "", $hListView, "GetSelected") Sleep(150) ConsoleWrite("$SelectedItem=" & $SelectedItem & " ") $ItemTxt = ControlListView($hGPO, "", $hListView, "GetText", $SelectedItem, 3) Sleep(50) ConsoleWrite("$ItemTxt=" & $ItemTxt & @CRLF) Sleep(300) Next EndFunc ;==>_Example10 yes but it is not working in the editor, so I was thinking of putting it in code and only if i have More than one result turn it on the search function Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 3 minutes ago, ioa747 said: platform most is 64 bit Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 3 minutes ago, gal9 said: yes but it is not working in the editor, so I was thinking of putting it in code and only if i have More than one result turn it on the search function you don't need to put this anywhere we did it as demo just to get the path from the $hListView control I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 4 minutes ago, ioa747 said: you don't need to put this anywhere we did it as demo just to get the path from the $hListView control you can see https://usaupload.com/6UXx/aaa_(4).mp4 It runs without problems if it is exe Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 Yes, but why? gal9 1 I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 2 minutes ago, ioa747 said: Yes, but why? I don't know, that's why I thought to insert in the code with a search and to check if it works and print with PopUp Link to comment Share on other sites More sharing options...
ioa747 Posted March 22, 2023 Share Posted March 22, 2023 Of course If you think you found a way to go further I'm stuck gal9 1 I know that I know nothing Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 (edited) 7 minutes ago, ioa747 said: Of course If you think you found a way to go further I'm stuck I was just thinking if you can add it to my code. I'm doing a search and after if i have More than one result call the search function it gets only the path and if the same path sends enter . and for To check if it takes the path we will make a MsgBox Edited March 22, 2023 by gal9 Link to comment Share on other sites More sharing options...
gal9 Posted March 22, 2023 Author Share Posted March 22, 2023 (edited) 14 minutes ago, ioa747 said: Of course If you think you found a way to go further I'm stuck ok it works for me this is my antivirus now how i can to add to the code? you can help me with that please? Edited March 22, 2023 by gal9 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