Task To Wake Up Computer From Sleep Mode & Run Consumer/Home Anti-Virus Scan (v16.8 Or Higher only)

Version 10

    This courtesy of user maynardp - any problems with it please post your question in VirusScan as  a New Discussion.

     

    McAfee Anti-Virus 16.8+ includes a command line scanner that can be launched from the Windows Task Scheduler - this allows you so set up a scheduled task and have it wake up the PC from Sleep Modeand because it was scheduled by windows, it will complete BEFORE the system is allowed to sleep again.

     

    For those who have never setup a task before, it is really quite easy, but there are a lot of options and settings - so it looks complex.

    Below I've detailed (in text, because I'm too lazy to do screen shots) all the info I used to set this up.

    Perhaps someone else would like to do a full tutorial with pictures...

     

    The command line scanner should be in "C:\Program Files\McAfee\VirusScan\mcodsscan.exe"

    - if not, you'll need to search for "mcodscan.exe"

    - if it doesn't exist, you're SOL.

     

    The available command line options for this program are:

    -- Scan Options (Required) --

    --fullscan, -f, -full                           Perform a full scan

    --quickscan, -q, -quick                  Perform a quick scan

    --customscan, -c, -custom            Perform a custom scan

    --filescan, -fd <value>... <value>    Scan specified files

     

    -- Custom Scan Options  --

    -where <[Drive]:\ | all | critical | desktop | my_docs | prog_files>  

               Specify one or more areas to scan during custom scan. When all is specified all other options are ignored.

    -threats <all | spyware | stealth | unknown_viruses>

               Specify the types of threats to scan during custom scan. When all is specified all other options are ignored.

    -types <all | nozip | programs_docs>

                Restrict the types of files scanned during custom scan.

    -exclude <value>... <value>

                 Exclude files and folders from a custom scan.

    -noexclude

                  Reset any files and folders that are excluded from custom scan.

     

    -- Action Options  --

    -pupaction <remove | trust>                     Take the specified action on potentially unwanted programs

     

    -- Output Options  --

    -log <value>                                           Specify the file to output scan results to

     

    -- Help Options  --

    -h                                                          Display this usage

    -?                                                          Display this usage

     

    With this information, it is now possible to create your own custom scheduled task and get McAfee working the way you want it to.

     

    Launch Windows Task Scheduler

    - in windows 8, this can be done by searching for 'schedule' in the application search or from Control Panel -> System and Security -> Administrative Tools

        - if you use control panel, a window listing of all the Admin tools will be displayed, one of which is Task Scheduler

     

    Once Task Scheduler has started, follow these steps

    Create a new task (not a basic task) Action -> Create Task...

         - this will open a Create Task dialog box

    Fill out the task details (on each Tab) as follows:

         General Tab:

              Name: <give your task some name you'll recognise - I used "Scan for Viruses">

              Location: \

              Author: <this should be your computer and userid - it can't be changed>

              Description: if you want, provide a more detailed description of what this task does

              Security options:

                   When running the task, use the following user account:  <leave this as your user or change it - up to you>

                   Run only when user is logged on (uncheck this one)

                   Run whether user is logged in or not  (check this one)

                        Do not store the password: (check this one)

                   Run with highest privileges (if checked, task should finish sooner)

              Hidden: (not sure what this does, so I left it unchecked)

              Configure for: <select your version of windows - I used "Windows 8.1">

     

         Triggers Tab:

              click the "New..." button at the bottom of the tab

              this will open a New Trigger dialog box

              Begin Task: <On a schedule> (this will allow you to schedule a task to run at specific dates and times)

               - fill in the setting details as fits your needs to schedule a virus scan when you want it to run

              Synchronize across timezone shouldn't be needed unless you are setting up a laptop and you travel a lot

              Advanced Settings:

                   you shouldn't need to set these if you are setting up a scan to run when you are away from your PC

              Enabled: (check this)

              Click OK to save this trigger

              You should now see a Trigger in the Triggers Tab

     

         Actions Tab:

              click the "New..." button at the bottom of the tab

              this will open a New Action dialog box

     

              Action: <"Start a Program"> (this will allow you to select a program to run)

              Settings:

                   Program/script:

                        use the browse button and then find "mcodsscan.exe"

                        on windows 8.1, it is in "C:\Program Files\McAfee\VirusScan\mcodsscan.exe"

                   Add arguments:

                        for me, I'm running a full scan and saving the results to a log file so these are the arguments I used:

                             --fullscan -log C:\Users\<my user name>\Documents\virusScanLog.txt

                        this runs a full scan of all disks and appends the results of each scan to the "virusScanLog.txt" file

                        this allows me to see the results by opening the file

                        I'm sure there are better methods to get the reports, but this works fine for me

                   Start in: <leave blank if doing a full scan>

                   Click OK to save this trigger

                   You should now see an Action in the Actions Tab

     

     

         Conditons Tab:

              Start the task only if the computer is idle for: (unchecked)

                   - the whole point of what we are doing is to run a task when its sleeping - so we know its idle

              Start the task only if the computer is on AC power (recommend you check this one)

                   Stop if the computer switched to batter power (recommended for notebooks)

              Wake the computer to run this task (definitely check this one)

              Start only if the following network connection is available: (if doing a local disk scan - this isn't needed)

     

         Settings Tab:

              personally, I unchecked all of these and then set the last setting "if the task is already running..." to:

                   <Do not start a new instance>

              this will prevent multiple scans from starting if something goes haywire

     

         Now click the "Ok" button to save the task

     

    I also personally enabled task history - so that I could see if there were issues getting the task to run.

    This is available from the menu Actions -> Enable All Tasks History

       - you might need to select "Task Scheduler (Local)" in the left pane if that option is not visible to you.

     

    And that's it.

    Oh and you should probably disable scheduled task in McAfee Security Center - but I'm not going to describe how to do  that here - McAfee should have instructions if you need them.

     

    My computer is set to sleep after 15 minutes of idle time.

    This task woke up my sleeping computer; ran the virus scan (which took 59 minutes); and then allowed the computer to go back to sleep about 15 minutes after the scan completed.

     

    Hope this helps someone out.