IT Management Suite

 View Only
Expand all | Collapse all

Uninstall a .msi using command script

  • 1.  Uninstall a .msi using command script

    Posted Aug 12, 2013 01:12 AM

    hello

    I am trying to uninstall all versions of Office Communicator R2 on our users computers. This is the script I have:

     

    taskkill /IM communicator.exe /F

    msiexec.exe /x {23E5396B-F5C5-4D56-A166-B6E111C4D36C} /qn
    msiexec.exe /x {0D1CBBB9-F4A8-45B6-95E7-202BA61D7AF4} /qn
    msiexec.exe /x {CEECF731-3F08-4210-8073-7E87F58C01D3} /qn

     

    Problem:

    On a test computer, communicator was uninstalled when the above script was ran but I got the Error 1605. I later confirmed that the msi code for the version of communicator installed on my test computer was  {0D1CBBB9-F4A8-45B6-95E7-202BA61D7AF4}.

    How can modify my script so that I can uninstall all possible versions of OCS installed on all computers?

    Thank you in advance for your assistance



  • 2.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 01:19 AM

    Hi efyuze,

    Please tell me your OS version which is uninstall OCS.



  • 3.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 01:33 AM

    hi

    the system of my test PC : Windows 7 32bits

    thanks



  • 4.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 02:04 AM

    Hi,

     

    try this script for Windows 7 64 bit and 32 bit...

    If its not working for 32 bit Please reply 

    try with Administrator user.

    msiexec.exe /x {928EE567-49F9-4082-A7B3-9BB82CD3C0FE} /qn



  • 5.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 02:17 AM

    hi Sachin,

    thank you for your reply. I just tried your script but got a error 1605.

    I will continue to search

     

    thank you



  • 6.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 02:25 AM

    Hi Efyuze,

    can you tell me how to run this script. 

    becoz i had tested this script and its working, 

    can you please provide me your .msi file.....



  • 7.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 02:43 AM

    HI,

    Error code 1605 = "This action is only valid for products that are currently installed."

    So you need to check Product Uninstall string and create different-Different script.

    http://social.technet.microsoft.com/Forums/systemcenter/en-US/b0ff996e-9235-4682-8b28-71011e84fe7e/uninstall-program-using-msi-error-exit-code-is-1605-the-execution-status-is-failurenonretry



  • 8.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 02:47 AM

    Hi Efyuze,

     

    Provide me .msi  file, so I can give a proper script.  



  • 9.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 03:43 AM

    Check the article

    http://social.technet.microsoft.com/Forums/lync/en-US/3f7976b8-db5b-422c-93c5-d2277dc506df/silent-uninstall-office-communicator-without-restart

     



  • 10.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 05:12 AM

    Hell Sachin

    I dont know how to send you the msi but the above msi codes where identified in Altiris (for all the different versions of OCS, including MUI that we have). So these msi codes are correct. My problem is first identifying the msicode installed on a particular machine and running the correct uninstall msiexec command.

    I am currently searching a powershell solution or command script to first identify the msicode and then run the correct uninstall script



  • 11.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 05:25 AM

    hi james and aj

    thank you for the articles.

    regards



  • 12.  RE: Uninstall a .msi using command script
    Best Answer

    Posted Aug 12, 2013 08:03 AM

    Run this query:

     

    SELECT     Distinct DisplayName, DisplayVersion, UninstallPath
    FROM         dbo.Inv_AddRemoveProgram
    WHERE     (DisplayName LIKE N'%communicator%')
    This will show all the versions of Communicator that Inventory has found in your environment together with their msi codes.
     
    Your script will always return a 1605 error because most of the uninstall lines will fail with that error.
     
    And I'd run:
    msiexec.exe /x {CEECF731-3F08-4210-8073-7E87F58C01D3} /qn /norestart /l*v "%temp%\communicatorUN.log"

     



  • 13.  RE: Uninstall a .msi using command script

    Posted Aug 12, 2013 05:48 PM

    Hi andy

    thank you for the script. I am working on creating a filter for each of the versions.

    the uninstall script did not work - still un 1605 error.



  • 14.  RE: Uninstall a .msi using command script

    Posted Aug 13, 2013 07:38 AM

    Unless the last GUID in the script is the one on that PC the script will always return 1605. But one of the earlier lines may have worked.

    You could put:

    IF "%ERRORLEVEL%"=="0" (EXIT 0)

    after each msiexec line.



  • 15.  RE: Uninstall a .msi using command script

    Posted Aug 13, 2013 06:31 PM

    Hi andy,

    noted with thanks. You know what, my main aim for uninstalling OCS R2 is that we are migrating to Lync 2010 so my plan was to uninstall OCS and then install Lync.

    I just found out frown that that lync2010 (the .exe version) will uninstall all previous versions of OCS automatically and then install Lync!!! source: http://technet.microsoft.com/en-us/library/gg425733(v=ocs.14).aspx, http://blog.insidelync.com/2012/02/top-10-faq-for-planning-a-lync-2010-client-deployment/

    so anyway, I am now back to fixing up my Lync2010 packages (lyncsetup.exe, Lync.msp, lyncMUI.exe) for installation. I am also currently trying to figure out how I create a filter based on the user's OS Language. But that is a seperate poste!

    thank you all for your replies to my question !!!

    regards

     



  • 16.  RE: Uninstall a .msi using command script

    Posted Aug 14, 2013 05:49 AM

    For the record, this sort of requirement is easily addressed with VBScript, checking the exit code returned by each MSIEXEC call and treating 0 and 1605 as success codes.

    There are also code samples out there on the internet where you can extract the entire list of GUIDs for installed MSI apps and then you could parse through them and uninstall any that meet your criteria.



  • 17.  RE: Uninstall a .msi using command script

    Posted Aug 14, 2013 07:22 AM

    Thanks Edt, think i will have to start learning VBScript for situations like thesesmiley



  • 18.  RE: Uninstall a .msi using command script

    Posted Aug 14, 2013 07:57 AM

    It's much easier adding:

    IF "%ERRORLEVEL%"=="1605" EXIT 0

    at the end of your batch file than lines of vb code.