cancel
Showing results for 
Search instead for 
Did you mean: 
dmini
Level 7
Report Inappropriate Content
Message 1 of 3

Virusscan 8.8 patches and return codes

Is there a list of the return codes for the patch installs? I have a batch file that says it is going to check for one return code (meaning the product is already at a higher version than the patch ) and then checks for a different code. entirely

Thanks

2 Replies

Re: Virusscan 8.8 patches and return codes

Hi dmini,

I am guessing that you are working in an 'Unmanaged' VSE environment or otherwise I would suggest leaving it to ePO.

Since this is used within a batch file, do your 'List of Return Codes' mean ERRORLEVEL? Using ERRORLEVEL values only work after executing a command and the value is lost after the console is closed or another program changes the value.

If you are trying to decide whether to install a new patch based on the current patch level, the current patch version is kept in the Registry and can be read from within a batch file.

Here are a couple of snippets of code that might be helpful: (I am assuming VSE v8.8 is installed, which needs to be checked in your environment.)

I show 2 different ReadPatch routines for you to choose from. I think the first one is the most reliable, but it is slower.

<code>

@echo off

    setlocal EnableExtensions EnableDelayedExpansion

    call :ReadPatch

    if /i %_VSE.Patch% LEQ 1 (

rem Put code here to install Patch 2, etc.

    )

    call :ReadPatch

    if /i %_VSE.Patch% GEQ 2 (

        if /i !_VSE.Patch! LEQ 5 (

rem     Put code here to install Patch 6, etc.

        )

    )

    call :ReadPatch

    echo  VSE Patch Level = %_VSE.Patch%

    call Smiley FrustratedetErrLvl %_VSE.Patch%

(

    endlocal

    exit /b %ERRORLEVEL%

)

Smiley FrustratedetErrLvl

exit /b %1

:ReadPatch

    set _VSE.Patch=0

    for /L %%L in (0 1 12) do (

        for /F "usebackq skip=2 tokens=1-2*" %%G in (`Reg QUERY "HKLM\SOFTWARE\McAfee\DesktopProtection" /v "Patch_%%L" 2^>NUL`) do (

            if /i "%%~G"=="Patch_%%L" (set _VSE.Patch=%%L)

        )

    )

goto :eof

:ReadPatch

:: Alternative, works with VSE v8.8 only.

    set _VSE.Patch=0

    for /F "usebackq skip=2 tokens=1-2*" %%G in (`Reg QUERY "HKLM\SOFTWARE\Network Associates\ePolicy Orchestrator\Application Plugins\VIRUSCAN8800" /v "HotFixVersions" 2^>NUL`) do (

        if /i "%%~G"=="HotFixVersions" (set _VSE.Patch=%%I)

    )

goto :eof

</code>

I strongly advise not changing any of the registry values or keys, but simply QUERY. This bit of code will most likely need to change with each VSE version and Patch version. And in your environment, please TEST, TEST, TEST, before using this code in production.

Hope this helps.

Ron Metzger

Re: Virusscan 8.8 patches and return codes

How is it going?  Like any help? Comments?

Ron Metzger