Wilson WindowWare Tech Support

WinBatch WinBatch+Compiler WebBatch
Home | Tech Database | Tech BBS | White Papers | Purchase


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
winbatch@tfic.com