ph777 Posted August 19, 2007 Share Posted August 19, 2007 Run("RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl") WinWait("Windows Firewall") WinWaitActive("Windows Firewall") Send("^{TAB}") In the Programs and services field, i want to uncheck certain services. For ex..... files & printer share unchecked, remote desktop checked, and so on.... thanks Link to comment Share on other sites More sharing options...
Paulie Posted August 19, 2007 Share Posted August 19, 2007 This works for me, you may or may not have the same controlID for the listview, use the autoit window info tool to find it. #Include <GuiListView.au3> #include <Array.au3> Run("RunDll32.exe shell32.dll,Control_RunDLL firewall.cpl") WinWait("Windows Firewall") WinWaitActive("Windows Firewall") Send("^{TAB}") Sleep(1000) $Hwnd = ControlGetHandle("Windows Firewall","",102);change 102 to whatever your ControlID for SysListView32 is $Count = _GUICtrlListViewGetItemCount($Hwnd) Dim $Items[$Count+1] $Items[0] = $Count For $i = 1 to $Items[0] $Items[$i] = _GUICtrlListViewGetItemText($Hwnd, $i-1) Switch $Items[$i] Case "File and Printer Sharing" _GUICtrlListViewSetCheckState($Hwnd, $i-1,0) ;This will Uncheck File and Printer Sharing Case "Remote Desktop" _GUICtrlListViewSetCheckState($Hwnd, $i-1,1) ;This will Check Remote Desktop EndSwitch Next _ArrayDisplay($Items) I hope this helps Link to comment Share on other sites More sharing options...
ph777 Posted August 19, 2007 Author Share Posted August 19, 2007 I tried it and it didn't work ........... hmmm I'm using Win XP pro. My Control ID is the same (102). Link to comment Share on other sites More sharing options...
Paulie Posted August 19, 2007 Share Posted August 19, 2007 I tried it and it didn't work ........... hmmm I'm using Win XP pro. My Control ID is the same (102).Did the arraydisplay on the end at least display the items?Because this worked for me the first time, however, i just retested it, and it did not check or uncheck anything however it still correctly read all the programs on the list.Odd...Different results running the same code twice... Link to comment Share on other sites More sharing options...
ph777 Posted August 20, 2007 Author Share Posted August 20, 2007 (edited) Yes it did show the list. the ones that i wanted unchecked were NOT on the list. I could use the Send command way, but it's kinda buggy.... Edited August 20, 2007 by ph777 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