Hi all

i am trying to uninstall 3 previous versions of a program which could be on machines prior to installing a new one

i have one program created in sccm 2007 which is the new install, before that runs it is set to run a bat file which simply executes

msiexec.exe /x {1110000-111000--11100011---} /qn
msiexec.exe /x {1110000-111000--11100011---} /qn
msiexec.exe /x {1110000-111000--11100011---} /qn

they are just example codes


the issue i am getting is im not worried if they arent installed i just want them to skip and continue and remove them if they are present, but non of the old versions are present on my test machine and when deploying in sccm its failing at the uninstall.bat phase with 1605 - only valid for products installed and not running the install.

can anyone suggest a way to skip these processes only if they are installed and still run the other program as im stumped with this?



0 Comments   [ + ] Show Comments


Please log in to comment



populate the Upgrade table of the new version and that installation will take care of the uninstall's of any previous version.




Answered 12/18/2012 by: jaybee96
Red Belt

  • When futzing with upgrades, be mindful of where the RemoveExistingProduct standard action is positioned.
Please log in to comment

You can first check for the products uninstall registry key and if present, only then run the uninstall command.. This can be easily done in batch or vbscript.

Answered 12/18/2012 by: piyushnasa
Red Belt

Please log in to comment

Can you try this..


GoTo CheckPreviousVersion01

Reg Query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{1110000-111000-11100011---}"
If %ErrorLevel%==0 GoTo UninstallPreviousVersion01
GoTo CheckPreviousVersion02

REM Uninstalling ........
Start /Wait msiexec.exe /x {1110000-111000--11100011---} /qb!

Reg Query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{1110000-111000-11100011---}"
If %ErrorLevel%==0 GoTo UninstallPreviousVersion02
GoTo CheckPreviousVersion03


REM Uninstalling ........

Start /Wait msiexec.exe /x {1110000-111000--11100011---} /qb!

Reg Query "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{1110000-111000--11100011---}"
If %ErrorLevel%==0 GoTo UninstallPreviousVersion03
GoTo InstallNewVersion


REM Uninstalling .......

Start /Wait msiexec.exe /x {1110000-111000--11100011---} /qb!

Echo Uninstall is Complete.
Echo Installing the new version...
Start /Wait msiexec.exe /i "%~dp0LatestVersion.msi" /qb!

Answered 12/19/2012 by: jagadeish
Red Belt

  • hi thanks for this
    found something similar
    but sccm still reported and error
    way round it to add exit to my bat file with the parameters /b 0
Please log in to comment

From an SCCM point of view (not the MSI package) you could create a task sequence to run all your items. Remove the 3 uninstalls from the batch file, and add each one as a task in the sequence along with your install.

You could then set continue on error on the steps that may cause problems, so the sequence will run and result in the new product installed, after removing all previous - if present.

The MSI upgrade method is the best approach, but my suggestion is another approach that may work for your situation.

Hope that helps,


Answered 12/19/2012 by: dunnpy
Red Belt

  • Hi Dunpy
    the above doesnt work already tried that, it errored with 1605 "only valid for products installed"
    the way i got it to work was to run the batch file with a check and force the error code using exit /b o
    that way sccm pushed onto the next program

    its the first time i have come across programs not moving on and running the next, it should have ran through the batch file and just not uninstalled it, but was producing an error 1605
    forcing 0 let it then run the next bit
    • In the Task Sequence for each Run Command line, add 1605 to the list of Success Codes. You can also check the box to Continue on Error
Please log in to comment
Answer this question or Comment on this question for clarity