Author Topic: Schedule Windows Task  (Read 23316 times)

0 Members and 1 Guest are viewing this topic.


  • Guest
Schedule Windows Task
« on: November 06, 2005, 09:07:23 PM »
I am trying to schedule a scan using Windows scheduled tasks.
I am not using avast! tasks because windows tasks allow me to shedule the scan at night (by checking "wakeup the computer to run this task", enabling the realtime clock in BIOS, and placing the command in vbs script that shuts the computer down again after scanning).

When using the following command:
"D:\Program Files\Alwil Software\Avast4\ashCmd.exe" /* /_>null /P2 /R
I get the errors shown below.
No report file ASHCMD.RPT seems to be created.

What do the exit codes mean?
Does /* cause scanning all local disks, or do I have to explicitly specify the drives?
Is specifying "null" as STDOUT OK?

"ashCmd.job" (ashCmd.exe)
   Started 06.11.2005 20:37:40
"ashCmd.job" (ashCmd.exe)
   Finished 06.11.2005 20:37:50
   Result: The task completed with an exit code of (a41b).
"ashCmd.job" (ashCmd.exe)
   Started 06.11.2005 20:38:01
"ashCmd.job" (ashCmd.exe)
   Finished 06.11.2005 20:38:25
   Result: The task completed with an exit code of (c000013a).
"ashCmd.job" (ashCmd.exe)
   Started 06.11.2005 20:42:59
"ashCmd.job" (ashCmd.exe)
   Finished 06.11.2005 20:42:59
   Result: The task completed with an exit code of (57).


  • Guest
Re: Schedule Windows Task
« Reply #1 on: November 06, 2005, 09:14:57 PM »
Hi and welcome,
have a look at this made some months ago but still relevant I believe;action=display;threadid=3796

Offline igor

  • Avast team
  • Serious Graphoman
  • *
  • Posts: 11811
    • AVAST Software
Re: Schedule Windows Task
« Reply #2 on: November 07, 2005, 11:02:08 AM »
Yes, /* scans all the local disks, but the rest is somehow strange.

First, the arguments are case-sensitive (i.e. it should be /p, /r), second (at least I think so) there should be an = between the switch and the value (i.e. it should be /p=2).
Third, the redirection to null doesn't seem to be OK (at least for me, a file called "null" is created where the output is stored). Fourth, I am not sure why the std in/out redirection should be there at all - so I'd rather suggest something like
"D:\Program Files\Alwil Software\Avast4\ashCmd.exe" /* /p=2 /r="D:\report.rpt"

Regarding the errors:
C000013A means that Ctrl+C was pressed
a41b means "operation was stopped"
- i.e. is seems that the scan was interrupted by the user
57 means "invalid parameter", which is slightly strange (but it may mean various things).  :-\
« Last Edit: November 07, 2005, 11:04:27 AM by igor »


  • Guest
Re: Schedule Windows Task
« Reply #3 on: November 16, 2005, 09:33:33 PM »
Now it is working. For those interested I appended vb script I use to scan all local disks.

Set shell = WScript.CreateObject("WScript.Shell")

shell.LogEvent 4, "VirusScan started"

'using defined task
ScanCmd = q &  "D:\Program Files\Alwil Software\Avast4\ashCmd.exe" & q & " /@=" & q & "ScanAllDisks" & q

r =, 0, true)
if r > 1  then
  shell.LogEvent 1, "VirusScan failed", 2
end if
if r = 1  then
  shell.LogEvent 1, "Virus found", 1
end if
shell.LogEvent 4, "VirusScan ended"

'Hibernate ("rundll32.exe powrprof.dll, SetSuspendState")

I defined a Windows XP scheduled Task for the scirpt.
I checked the task property "Wake the computer to run this task".
And enabled the realtime clock (RTC) in the bios.
The script uses a Avast! task, so it shows up in Avast's session log.
I had to create my own Avast! task "ScanAllDisks"  because I could not get the builtin task "Scan: local discs" running using ashCmd