Greetings,

I have come to this cool site several times to look for batch file solutions to help my day to day tasks be easier so this is my first time posting a question
I have a task to remove Adobe Acrobat 6 from every machine (including its updates tied to Adobe Reader).

I am still re-learning some batch file commands that would make my work much easier. Long ago I would have made the script I need but over time I’ve had jobs where scripting was not needed so I’ve forgotten a lot. Yes next time I have those jobs I will still practice making scripts so I don’t forget.
Anyways, I have a list of machines that have Adobe Acrobat 6 installed. What I can’t tell is if each one has the upgrade all the upgrades.

This is what I want to remove which also I will remove them in order or last update first and Acrobat 6 last. I am able to make each removel individually but I am not sure how to tied all of them together.


Acrobat 6 = {AC76BA86-1033-0000-BA7E-000000000001}
Adobe Acrobat - Reader 6.0.2 Update = {AC76BA86-0000-0000-0000-6028747ADE01}
Adobe Acrobat and Reader 6.0.3 Update = {AC76BA86-0000-7EC8-7489-000000000603}
Adobe Acrobat and Reader 6.0.4 Update = {AC76BA86-0000-7EC8-7489-000000000604}
Adobe Acrobat and Reader 6.0.5 Update = {AC76BA86-0000-7EC8-7489-000000000605}
Adobe Acrobat and Reader 6.0.6 Update = {AC76BA86-0000-7EC8-7489-000000000606}



The removal will be either done using PSXEC or I would push it out using our deployment software. I know labels are not needed but they help me. Here is my psude code


IF EXIST HkLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-0000-7EC8-7489-000000000606} THEN GOTO Remove_Update_6

:Remove_Update_6
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000606} /qn /norestart

IF EXIST HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-0000-7EC8-7489-000000000605} THEN GOTO Remove_Update_5

:Remove_Update_5
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000606} /qn /norestart

IF EXIST HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-0000-7EC8-7489-000000000604} THEN GOTO Remove_Update_4

:Remove_Update_4
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000604} /qn /norestart

IF EXIST HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\{AC76BA86-0000-7EC8-7489-000000000603} THEN GOTO Remove_Update_3

:Remove_Update_3
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000603} /qn /norestart

IF EXIST HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall{AC76BA86-0000-0000-0000-6028747ADE01} THEN GOTO Remove_Update_2

:Remove_Update_2
MsiExec.exe /uninstall {AC76BA86-0000-0000-0000-6028747ADE01} /qn /norestart

IF EXIST HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall{AC76BA86-1033-0000-BA7E-000000000001} THEN GOTO Remove_Acrobat

:Remove_Acrobat
MsiExec.exe /uninstall {AC76BA86-1033-0000-BA7E-000000000001} /qn /norestart
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Why not just push Adobe Reader X (or Adobe Acrobat X with the REMOVE_PREVIOUS_READER property set) so that it removes all previous versions from 6.x - 9.x?
Answered 03/18/2011 by: mazessj
Blue Belt

Please log in to comment
0
My company wants to switch to another type of product. We could leave acrobat installed, however, because Adobe no longer provides updates to Acrobat 6, our information security policy prohibits the use of Acrobat 6.

I know my script/batch is missing some pieces, I know I can query but I have not been able to query and if found take the appropriate action.

Thank you
Answered 03/18/2011 by: LunchBox
Senior Yellow Belt

Please log in to comment
0
Instead of checking for the existence of each product, you could instead rely on the return codes of MsiExec. After each uninstall, check for the following exit codes:
3010 = success, reboot required
1605 = product not found
0 = success

Any other exit code can be considered a failure.
In the world of DOS batch, it might look like this:


:Remove_Update_6
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000606} /quiet /norestart
IF ERRORLEVEL 3010 IF NOT ERRORLEVEL 3011 GOTO Remove_Update_5
IF ERRORLEVEL 1605 IF NOT ERRORLEVEL 1606 GOTO Remove_Update_5
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 GOTO Remove_Update_5
GOTO ERROR

:Remove_Update_5
MsiExec.exe /uninstall {AC76BA86-0000-7EC8-7489-000000000606} /quiet /norestart
IF ERRORLEVEL 3010 IF NOT ERRORLEVEL 3011 GOTO Remove_Update_4
IF ERRORLEVEL 1605 IF NOT ERRORLEVEL 1606 GOTO Remove_Update_4
IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 GOTO Remove_Update_4
GOTO ERROR
(etc.)
...GOTO END

:ERROR
REM Do error handling stuff here
ECHO Error %ERRORLEVEL% returned. Uninstall failed.

:END


Not pretty, but it allows you to blindly uninstall and still make sure that it isn't failing.
Answered 03/21/2011 by: mazessj
Blue Belt

Please log in to comment
0
Cool that is much better. I did not think of doing it like that (but next time I will:)). I will try this out.

With your sample code, lets say that one of the updates was not in the installed previsouly what would happend as the process ran through the code? W

Would it run like this?
Removing Update 6 . . . . Removed
Hhhmm Update 5 not found . . . . moving on to update 4
Removing Update 4 ETC

Thank you
Answered 03/22/2011 by: LunchBox
Senior Yellow Belt

Please log in to comment
Answer this question or Comment on this question for clarity