Proactive IT Security
 

Command line scanner error levels or return codes

Search Support Articles

SEARCH Advanced Search

Date published: 2004-01-23       Date updated: 2011-01-17

Product:
Endpoint Protection

Module(s):
Command line scanner

Operations System(s):
Windows XP 32 bits
Windows Vista 32 bits
Windows 2000
Linux
Windows XP 64 bits
Windows Vista 64 bits
Windows 95/98/Me
Windows NT
Novell Netware
Windows 2003 Server

Problem description

Using error level or return codes from the command line scanner.

Problem solution

When finished running, nvcc (and the DOS counterpart NVCCX) returns a given error level (or return code) which can be utilized in for example batch jobs or interpreted by other programs:

  • 0 All OK.
  • 1 File or boot sector viruses found and/or removed.
  • 2 Virus detected in (and removed from) memory
  • 3 No scan area given.
  • 5 Illegal argument.
  • 7 Internal error, the program continued to run.
  • 8 Internal error, the program aborted.
  • 9 Scanning aborted by user.
  • 10 Not all files could be scanned.
  • 11 Corrupted files/archives.

Return code 2 and 1 will override all other return codes. This means that even if NVCC has detected an invalid archive file which should make it to return 11, it will return 1 if it encounters infections further out in the scan. Testing return codes in a batch job may for example be done like this:

@\norman\nvc\bin\nvcc /C /LF:\nvc.log /l:1 /s /u %1 %2
@echo %errorlevel% >> error.log
@echo .
@goto error%errorlevel%

:error1
:error2

@echo Virus found!
@goto end

:error3
:error4

@echo Check argument list!
@goto end

:error7

@echo Internal non-fatal error.
@goto end

:error8

@echo Internal fatal error. NVCC stopped.
@goto end

:error9

@echo Scanning aborted by user.
@goto end

:error10

@echo Some files not scanned - no error.
@goto end

:error11
@echo Could not open some archive files.
@goto end

:error0

@echo No error

:end