Sign in to follow this  
Followers 0

Automatically disable McAfee settings

8 posts in this topic

#1 ·  Posted (edited)


I'm trying to automate the process of configuring the three McAfee settings seen in the image I've attached (Host IPS, Network IPS and Firewall).  Clicking one of them toggles the setting and closes the menu.  I want them all OFF.  This script will be used on different computers so the settings might be have different initial setups.

This is my first time using AutoIt and I have very limited coding experience--mostly MATLAB.  Please excuse any lack of knowledge or terminology. 

So far my code is able to
1. Find the visible McAfee icon in the system tray. 
2. Click the icon.
3. Send "Q" to open up the Quick Settings menu.
4. Toggle settings blindly using keystrokes.

The problem I'm having is I don't know how to "read" the status of the setting before toggling it.  This means I might be switching it from Off to On by mistake,

when I should really just leave it alone. 


I'm wondering a couple of things. 


1. Is there an easy way to "read" the status of the setting?  This would solve the problem.  Part of the challenge with this overall assignment is that there doesn't

seem to be any sort of "control" built into these menus.  In other words, the only thing that changes in Au3Info when you hover over different options is the

coordinates of the mouse--there aren't any unique control IDs or texts to my knowledge that differentiate between different settings or menus.  I don't know how to search for text in a menu and get an index or anything like that.  I've attached my code at the bottom and commented-out two ideas I had for reading the status and acting accordingly after "Send (Q)".  Neither of which were fruitful. 


2. Is there an alternative to the overall method I've chosen that is simpler and more robust?  It seems like there must be an alternative path to these settings besides the system tray, but I don't know of any such paths.   The final script is going to be used on a number of computers which may have the McAfee icon either hidden or visible in the system tray, but currently my script only works if it is visible.  I haven't figured out how to access hidden icons with mouse clicks yet. 


I should also mention that most of my code for step 1 (find the McAfee icon) comes from something I found online.  I've stared at it for a while, and I think I know how it works, but I wouldn't have known those GUI commands existed and wouldn't have been able to write that bit of code on my own.    I don't want you to overestimate my understanding of AutoIt.  Sorry for the long post, just wanted to provide all the relevant info. 


Any advice you can offer would be greatly appreciated!  Thanks in advance.



AutoIt McAfee disable

#Include <GuiToolBar.au3>
#Include <GUIConstants.au3>

Local $Array[3]

For $Element In $Array

    Global $hSysTray_Handle, $iSystray_ButtonNumber
    Global $sToolTipTitle = "McAfee status: OK" ; <<<<<<<<<<<<<<<< Enter some tooltip text for the icon you want here
    $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle)

    If $iSystray_ButtonNumber = 0 Then
        MsgBox(16, "Error", "Icon not found in system tray")
        _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right")

    Send( "Q" )
    ;$DropDownHandle = Controlgethandle( "", "Host IPS - on", "")
    ;$text = ControlGetText( "", "Host IPS - on", "")
    ;If "Host IPS - on" = 1 Then
    ;   Send( $Element )




Func Get_Systray_Index($sToolTipTitle)

    ; Find systray handle
    $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]')
    If @error Then
        MsgBox(16, "Error", "System tray not found")

    ; Get systray item count
    Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle)
    If $iSystray_ButCount = 0 Then
        MsgBox(16, "Error", "No items found in system tray")

    ; Look for wanted tooltip
    For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1
        If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop

    If $iSystray_ButtonNumber = $iSystray_ButCount Then
        Return 0 ; Not found
        Return $iSystray_ButtonNumber ; Found




Edited by irishsurfer22

Share this post

Link to post
Share on other sites

I'm trying to automatically configure the McAfee settings as seen in the link below. I am able to toggle the settings with key strokes, but I haven't figured out a way to "read" the setting before toggling it. This means the code might switch from the correct setting to the incorrect one. Any ideas on how to do this? Maybe there is an alternative method altogether. I've provided pictures of what Au3Info shows for some of the menu options in the link. There is no difference is Au3Info between the three settings when I hover over them except the mouse position.  I made a post about this a few days ago, but it was long and didn't get any responses so this is round 2.  I hope I'm posting this in the right forum. 

Thanks in advance!

Share this post

Link to post
Share on other sites

I guess I'm not sure how this works.  I wanted to delete the original post, but couldn't figure out how.  And now I see my second one under the first?  I assumed it was more like reddit where a "topic" is like a post.

Share this post

Link to post
Share on other sites

I merged the two, as they were in the same vein; we ask that forum members stick to one thread per topic. Why do you want to delete the first, as it has much more information on what you're trying to do than the second?

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post

Link to post
Share on other sites

#6 ·  Posted (edited)

Oh okay, that makes more sense.  It didn't get any responses so I figured it was probably too long for anyone to want to read through.  I guess it's possible that a lot of people read it and just didn't have any ideas, but there's no way for me to know that.  Seems more likely that it never got to the right set of eyes.  Any forum advice?

Edited by irishsurfer22

Share this post

Link to post
Share on other sites

My general posting advice would be:

  • First and foremost always, ensure your question does not violate the forum rules.
  • Do a thorough search of the forum before you post; use something like this in google:
    • McAfee Settings
  • When you do post, ensure you are providing a detailed description of what you are trying to accomplish.
  • Also include an example of the effort you have put forth on your own:
    • most forum members will not spoon-feed code to you, they like to see you're really interested in learning.
    • The "it's just too complicated, it's easy for you guys, someone just do it for me" mentality will not be received well (not saying this is what you did).
  • Even after posting, continue to research the issue:
    • Wait 24 hours before bumping your thread, but when you do make it a meaningful bump.
    • Instead of just "bump", include what you have been doing in the past day, week, etc. to resolve the issue, and where you are stuck.

When you're dead, you don't know you're dead - it's only difficult for those that know you. It's the same way when you're stupid...

My Scripts: SCCM UDFInclude Source with Compiled Script, Windows Firewall UDF

Share this post

Link to post
Share on other sites

Nevermind, my coworker just now resolved the issue.  The trick was to use WinMenuSelectItem("","","Quick Settings","Host IPS - on")

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  
Followers 0

  • Similar Content

    • pinkfoyd
      [SOLVED] Reverse state of button
      By pinkfoyd
      I remember a script where i had seen an user inverse state of a button ( $GUI_ENABLE (64)   /  $GUI_DISABLE (128) ) in one line only
      I remember it use Bit operation but i cannot reproduce it, can someone help ?
      In fact if the button is enable i want to disable it and if he is disable , want to enable it, something like that :
      GuiCtrlSetState ( $button , BitOr ( GuiCtrlGetSate ( $button ) )        ; i know this is NOT working, for explanation only
      Thanks !
    • TheAutomator
      Disable Visual Style For Single Control
      By TheAutomator
      Hi, i'm not a very educated guy when it comes to dll calls..
      can someone help me do this:
      DllCall("uxtheme.dll", "none", "SetThemeAppProperties", "int", false) for only one control?
    • TheDcoder
      [Sloved] How to disable a edit control without graying it?
      By TheDcoder
      Hello! I think the thread title is obvious enough , Here is my code:
      #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 290, 139, 192, 124) $Edit1 = GUICtrlCreateEdit("Test", 8, 8, 273, 121, $ES_READONLY) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd  
      Thanks in advance, TD
    • colombeen
      Enable/Disable network card WMI
      By colombeen
      Hi guys
      I've been looking around to enable/disable network cards using WMI but so far the only way i could get it to work was with this :
      RunWait(@ComSpec & " /c " & "WMIC PATH Win32_NetworkAdapter WHERE Index=" & $NetAdp_CurrID & " CALL " & $action, "", @SW_HIDE) The $NetAdp_CurrID var would be the index of the network card and the $action var would be enable or disable in my line of code.
      I know it's possible to do this with wmi without using cmd but i can't figure out how.
      Anyone who has the answer to my problem?
      I've tried with using the wmi query and adding .enable() and .disable() at the end but that doesn't work (or at least not for me)
    • RaiNote
      CUI Compiled
      By RaiNote
      would there a way to disable enable the CUI after the exe was compiled If a certain Action is being used?