Edit: This appears to be an issue with the way the %errorlevel% is getting passed to the if statement. This only happens when the script is getting run through kbox and does not happen when it is getting run manually. 

I am trying to deploy an uninstall script for Bluebeam using kbox. The script itself will run correctly when it is run manually from the Kace dependency folder on the computer but when it is run from kbox the script is not running correctly. Here is the script and the kbox results

TASKKILL /F /IM "BBPrint.exe"

REM If upgrading 10.0 or 10.1, and you installed to a custom path, please fix the INSTALLDIR path below:
SET INSTALLDIR=%ProgramFiles%\Bluebeam Software\Bluebeam Revu
SET ADMINPATH=Pushbutton PDF\PbMngr5.exe
SET VUADMINPATH=Bluebeam Vu Admin.exe

SET WCV=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield
SET WCV64=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield
SET WCVF=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders
SET WGF=%WINDIR%\Installer
SET ISII=%ProgramFiles%\InstallShield Installation Information
SET ISII64=%ProgramFiles(x86)%\InstallShield Installation Information

SET UNINSTALLKEY=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall

REM =========================================
REM Bluebeam v16 Master Release
REM =========================================

REM Uninstall Bluebeam Revu 16.0.4: 
SET GUID={21244472-3597-484D-BACB-7D093E97630D}
IF "%ERRORLEVEL%"=="0" msiexec.exe /x %GUID% /qn 

REM Uninstall Bluebeam Revu 16.0.4 x64:
SET GUID={B7D0D8F8-CCF4-4199-9593-351FC71C8483}
IF "%ERRORLEVEL%"=="0" msiexec.exe /x %GUID% /qn
Running as SYSTEM
Creating process returned non-zero: C:\Windows\System32\cmd.exe /c if EXIST "C:\Program Files\Bluebeam Software\Bluebeam Revu\2016\Revu\Revu.exe" exit 16: (0) The operation completed successfully.
Error Code: 0
Status Code: 16
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>TASKKILL /F /IM "BBPrint.exe"
SUCCESS: The process "BBPrint.exe" with PID 6344 has been terminated.
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM If upgrading 10.0 or 10.1, and you installed to a custom path, please fix the INSTALLDIR path below:
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET INSTALLDIR=C:\Program Files (x86)\Bluebeam Software\Bluebeam Revu
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET ADMINPATH=Pushbutton PDF\PbMngr5.exe
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET VUADMINPATH=Bluebeam Vu Admin.exe
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET WCV=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET WCV64=HKLM\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\InstallShield
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET WCVF=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\Folders
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET WGF=C:\Windows\Installer
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET ISII=C:\Program Files (x86)\InstallShield Installation Information
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET ISII64=C:\Program Files (x86)\InstallShield Installation Information
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET UNINSTALLKEY=HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM =========================================
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM Bluebeam v16 Master Release
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM =========================================
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM Uninstall Bluebeam Revu 16.0.4:
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET GUID={21244472-3597-484D-BACB-7D093E97630D}
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REG QUERY HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{21244472-3597-484D-BACB-7D093E97630D} 1>nul 2>nul
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>IF "1" == "0" msiexec.exe /x {21244472-3597-484D-BACB-7D093E97630D} /qn
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REM Uninstall Bluebeam Revu 16.0.4 x64:
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>SET GUID={B7D0D8F8-CCF4-4199-9593-351FC71C8483}
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>REG QUERY HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{B7D0D8F8-CCF4-4199-9593-351FC71C8483} 1>nul 2>nul
C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\1287>IF "1" == "0" msiexec.exe /x {B7D0D8F8-CCF4-4199-9593-351FC71C8483} /qn

When I run the script manually it finds the registry and runs the uninstall command but when kbox pushes the script it does not find the registry so it does not run through the script.

Any help is appreciated. I did not write the script, I am using the script that bluebeam provides with its enterprise installer.

1 Comment   [ - ] Hide Comment


  • Does the script copy to the computer? If so, does it attempt to execute?
    • Yes the script is copied to the computer and is run, but when kbox runs the script it does not run the same way as when I manually run the script on the computer.
      • Online or Offline script?
      • It is an Online KScript
      • Do you have "Windows Run As" set to a user that can execute it on your clients?
      • The script is set to run as local system, I have it set to run on the OS of the system, it is not scheduled.
Please log in to comment

Answer this question or Comment on this question for clarity


Well, my antennae are going "Wow6432Node! Wow6432Node!"
Answered 03/21/2016 by: VBScab
Red Belt

  • Hi Can you please elaborate on this?
Please log in to comment

64-bit location:

32-bit location:
SET UNINSTALLKEY=HKLM\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

If you need any further clarification, you should be handing the task over to somebody else.

Answered 03/22/2016 by: VBScab
Red Belt

Please log in to comment
Admin Script Editor
Admin Script Editor is an integrated scripting environment available free here at ITNinja