WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Miscellaneous

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

F-prot.exe Errorlevel Strangeness Workaround

Keywords: 

After virus scanning a single file using F-Prot for DOS under Windows 2000, I needed to get the errorlevel returned. I tried to RunWait F-Prot followed by IntControl64 with no success. I was forced to write out a BAT file and RunWait the bat file in order to get the correct errorlevel.

The following does not work correctly, reports 255:

RunWait("c:\f-prot\f-prot.exe", "c:\temp3\eicar.com /SILENT /ARCHIVE /DUMB /NOMEM /WRAP /REPORT=c:\temp3\report.txt")
errlvl=IntControl(64, 0, 0, 0, 0)
Message("Errorlevel is:", errlvl)
The following does not work correctly, reports 0:
RunWait("command.com ","/c c:\f-prot\f-prot.exe c:\temp3\eicar.com /SILENT /ARCHIVE /DUMB /NOMEM /WRAP /REPORT=c:\temp3\report.txt")
errlvl=IntControl(64, 0, 0, 0, 0)
Message("Errorlevel is:", errlvl)
The following is a workaround, reports 3:
batfile=FileOpen("c:\temp3\test.bat", "WRITE")
FileWrite(batfile, "c:\f-prot\f-prot.exe c:\temp3\eicar.com /SILENT /ARCHIVE /DUMB /NOMEM /WRAP /REPORT=c:\temp3\report.txt")
FileClose(batfile)
RunWait("c:\temp3\test.bat", "")
errlvl=IntControl(64, 0, 0, 0, 0)
FileDelete("c:\temp3\test.bat")
Message("Errorlevel is:", errlvl)
Exit
Bill Meek

Article ID:   W15540
File Created: 2011:01:12:09:34:50
Last Updated: 2011:01:12:09:34:50