Uninstall Applications from logon Script

HI, I got few applications to uninstall from domain PC's. I have create following bat file but can we run this from input file with all these GUID?

i need some logs to check this pc's are uninstalled before install new application?

-----------uninstall.bat ------------------------

:SP4.0x64

MsiExec /x {E2B8DE62-4F05-44BD-BEFC-78CF302466B4} /passive /l*v \\server\share\SP4_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP5.0x64 
MsiExec /x {5C039CB6-9026-4C74-9A63-152592021841} /passive /l*v \\server\share\SP5_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP4.0x32 
MsiExec /x {5CBB856A-B9A6-4239-9AAE-732242813D67} /passive /l*v \\server\share\SP4_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP4.0x64 
MsiExec /x {C431266B-4B1A-4BAF-836A-77B60911BE79} /passive /l*v \\server\share\SP4_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP3.0x32 
MsiExec /x {266EB766-9ABB-40D0-AB9F-41EE46D23876} /passive /l*v \\server\share\SP3_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP3.0x64 
MsiExec /x {E081D84F-CCBE-44C5-B8CA-E853B8F05EFB} /passive /l*v \\server\share\SP3_del.log
if %ERRORLEVEL% == 0 goto NEXT 

:SP2.0x32 
MsiExec /x {A0744DBD-6227-49CE-8377-D23A23EF0360} /passive /l*v \\server\share\SP2_del.log
if %ERRORLEVEL% == 0 goto NEXT 

February 23rd, 2015 12:52am

What is the issue you are running into exactly? I could not gather that from your initial post.

The guids should be fine for uninstallation, I do think there should not be a space in between the X and the GUID though. Also if you are running this script on multiple systems at the same time you might run into problems with the log files as multiple computers will attempts to get a write lock on the same log file. So I would recommend using separate log files for each computer.

Free Windows Admin Tool Kit Click here and download it now
February 23rd, 2015 1:06am

Uninstall requires a number of things/  It requires an elevated admin session.  This cannot be done from a login script.  You can uninstall from a startup script but a one time uninstall should probably be done differently.

The space after the /X is normal.

You cannot successful cascade most installer scripts.

The batch file posted in incomplete.

February 23rd, 2015 1:34am

Uninstall requires a number of things/  It requires an elevated admin session.  This cannot be done from a login script.  You can uninstall from a startup script but a one time uninstall should probably be done differently.

The space after the /X is normal.

You cannot successful cascade most installer scripts.

The batch file posted in incomplete.

Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 11:27pm

Each step blindly calls MSIEXEC and then test for errors. If there are no errors it does aa goto NEXT.  There is no label ":NEXT"

An uninstall requires elevation so it won't work in a logon except for an admin account.

If you are just running this as a batch file from an admin account then it might work but any error might cause unpredictable results.

Since we don't know what the package is or what you are expecting to happen that is all I can say.  I just though it odd that the batch seems incomplete.

February 26th, 2015 12:56am

Hi JRV,

  I just need a script to remove above applications form 50 PC's then run the another batch file to install the new software. These applications are installed from the MSI from the SOE.

 So i need uninstall each application and if successful /unsuccessful write that to a log file. 

 I prefer to ask users to restart their PC's and then put the message " Software is installing ...etc etc) then uninstall the old software and install new software.

I did this to a test pc's via Computer GPO but noticed that some applications are uninstalled and new application installed or some not installed. 

 I Put uninstalled.bat and installed.bat into GPO computer  logon section.

As

Free Windows Admin Tool Kit Click here and download it now
March 5th, 2015 1:30am

I repeat.  You cannot install/uninstall software from a logon script.  Installers are very tricky. What you are trying to do cannot likely be done for obvious reasons.

March 5th, 2015 4:36am

Hi JRV,

  I know we don't have the proper deployment tool to do this. As i said i can uninstall and install using the Script but only issue is no error/ fail  detection.

AS

 

Free Windows Admin Tool Kit Click here and download it now
March 5th, 2015 7:00pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics