Home Support

Command-Line Updates and Scans (AVG Business Antivirus)

Command-Line Updates and Scans (AVG Business Antivirus)

Command Line Updater/Scanner

Below are the folder paths to the AVG command line updater/scanner, and report files.

Default .exe File location:

  • %ProgramFiles%\AVG\Antivirus

Default Report File location:

  • %ProgramData%\AVG\Antivirus\report

ashUpd.exe (Updates)

Update Virus Definitions Command:ashUpd.exe vps [/autoreboot] [/help]

Update Antivirus Program Command:ashUpd.exe program [/autoreboot] [/help]

Extra Parameters

/autoreboot: reboots the computer after the update, if necessary

/help: displays a help screen

ashCmd.exe (Scans)

  • (area name): area for virus testing; there can be multiple areas in your command
  • /# or --remote: remote disks
  • /* or --local: local hard drives
  • /?, /h or --help: displays a short description of all parameters
  • /@ = expect string or --task = expect string: parameter contains name of task which will be started; other parameters are ignored
  • /_ or --console: application will be ready for STDIN/STDOUT
  • /a or --testall: test of all files
  • /c or --testfull: scan entire files
  • /d or --dontpanic: do not switch to 'panic mode' when a virus is found
  • /e = expect byte or --heuristics = expect byte: set the heuristic sensitivity, where 0 is no heuristics and 100 is the maximum sensitivity
  • /f = expect string or --fileactions = expect string=[BPSW] additional configuration for actions on infected files:
    • B: allow delayed actions (after reboot) for locked files
    • P: if a file cannot be removed from an archive, try to remove its parent(s) instead
    • S: do not remove associated auto-start references when removing a file
    • W: when an infected file is found in an archive, perform the action with the whole archive, not just the file inside
  • /g = expect byte or --checkgenuine = expect byte: =[0|1] check digital signatures of infected files (and ignore genuine)
  • /i or --ignoretype: ignore virus sets
  • /j or --paging: paging the lines if program is not in STDOUT mode (parameter /_)
  • /m or --boot: test boot sectors and whole operating memory
  • /p = expect byte or --continue = expect byte: program doesn't wait for user input (/p); automatic action with infected file (/p=[01234])
    • 0: fix automatically
    • 1: delete file
    • 2: quarantine
    • 3: repair
    • 4: stop when virus is detected
  • /q or --stopclean: stop on clean files and wait for user input
  • /r = expect string or --report = expect string: =[*~][file] create report file. * includes Ok files, ~ includes skipped files
  • /s or --soundoff: no sounds
  • /t = expect string or --archivetype = expect string: =[JZIMXRSTGCBWOEQHFVKPY7D6U4123AN]; default option is /t=XSW2
    Archive Types
    • J: ARJ
    • Z: ZIP
    • I: MIME
    • M: MAPI
    • X: DosExec
    • R: RAR
    • S: Streams
    • T: TAR
    • G: GZ
    • C: CAB
    • B: BZIP2
    • W: WinExec
    • O: ZOO
    • E: ACE
    • Q: ARC
    • H: LHA
    • F: TNEF
    • V: CPIO
    • K: CHM
    • P: RPM
    • Y: ISO
    • 7: 7ZIP
    • D: DBX
    • 6: SIS
    • U: OLE
    • 4: Mac
    • 1: Installer
    • 2: Dropper
    • 3: Emulator
    • A: All
    • N: None
  • /u = expect string or --sendmessage = expect string=(address) send message about found virus to selected address
  • /w = expect string or --exclude = expect string: =(mask) exclude specific file/folder from scanning (wildcards accepted)
  • /x = expect string or --virustypes = expect string: =[P] detect specific malware types that are not detected by default:
    • P: PUPs (potentially unwanted programs)

Return Codes

AVG uses both internal and Microsoft return codes.

Internal codes

  • <ExitCode Type='Success' Description='No threats detected'>0</ExitCode>
  • <ExitCode Type='Infected' Description='Threat was detected'>1</ExitCode>
  • <ExitCode Type='Warning' Description='Access denied'>5</ExitCode>
  • <ExitCode Type='Warning' Description='Sharing violation - file in use'>32</ExitCode>
  • <ExitCode Type='Error' Description='Invalid scan parameter specified'>87</ExitCode>
  • <ExitCode Type='Error' Description='Archive too large to be scanned'>42057</ExitCode>
  • <ExitCode Type='Error' Description='Operation cancelled by user'>42011</ExitCode>

You may also find return codes matching those in AVG Error Codes.

Microsoft codes

Microsoft codes can be found here.

Example AVG Batch Script

Please backup all/any critical/important data first before running the scan below. This is a scan you could run if you suspect the device is infected, but may take several hours!

@Echo Off

CD /D "%ProgramFiles%\AVG\Antivirus"

ashUpd VPS

ashCmd /* /a /c /e=100 /f=B /m /p=0 /t=A /w="%ProgramFiles%\Malwarebytes\*" /x=P /r=~"%ProgramData%\AVG\Antivirus\report\FullScan.txt"

"%WinDir%\System32\ShutDown.exe" /s /f /t 600 /c "Shutting down computer in 10 (ten) minutes! Please save all work immediately!"

Exit

  1. Changes directory to %ProgramFiles%\AVG\Antivirus
  2. Checks for virus definition updates (highly recommended before starting scan)
  3. Runs a full, thorough scan on local device, including boot sector, memory, all/whole files, and all archive files
    • Heuristic sensitivity is set at maximum (highest)
    • Attempts to fix infected files automatically, including locked files after restart
    • Excludes the %ProgramFiles%\Malwarebytes folders and files from scan
    • Also scans for PUPs (Potentially Unwanted Programs)
    • Creates %ProgramData%\AVG\Antivirus\report\FullScan.txt report file that includes skipped files
  4. Shuts down device after scan, and exits batch script

 

Was this article helpful?

Still looking for answers ?

Visit our AVG Support Community or contact us here:

Struggling with non-AVG technology? We can fix that, too!