Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Uninstall IE9 from Windows 7 with batch script or other scripting means

Posted on 2013-01-31
9
Medium Priority
?
4,230 Views
Last Modified: 2013-02-05
Greetings Experts.  It appears IE9 was installed during our Windows 7 deployment and now I need to remove it.  I have researched the heck out of this and found a popular script but I am not sure how to get around the "Operation failed with 0x80070005 Access is denied" error.  

I'm running this batch script from an elevated command prompt and also tried /quiet at the end of the script with no luck (obviously).
FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*9.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /norestart >NUL 2>&1" >NUL 2>&1

Open in new window


I tried this briefly as I wasn't getting anywhere with it and just decided to post the question to the web's best collection of wizard like minds.
@ECHO OFF
FOR %%A IN (%WINDIR%\servicing\Packages\Microsoft-Windows-InternetExplorer-*9.*.mum) DO (
	echo Uninstalling package %%A
	start /wait pkgmgr /up:"%%~fA" /norestart >NUL 2>&1 || start /wait pkgmgr /up:"%%~fA" /norestart >NUL 2>&1
)

Open in new window



Until I can resolve how to get around the error message popping up, I won't be able to launch the script on the remote pc's (250+).  All computers are running Windows 7 Pro in an AD environment.  Thanks for your help!
0
Comment
Question by:samiam41
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 26

Expert Comment

by:pony10us
ID: 38839863
http://www.experts-exchange.com/Software/Server_Software/File_Servers/Active_Directory/Q_27042751.html

may have the answer you are looking for if you are running WSUS in your environment.
0
 
LVL 9

Author Comment

by:samiam41
ID: 38839980
Thanks pony10us for the quick response.  Have to admit I didn't give much thought to that method but I just went into the WSUS server > highlighted the "Windows Internet Explorer 9 for Windows 7" update > selected Not Approved.  I undid this because of these questions:

Now will that begin the actual uninstall of IE9 on the computers in the domain?  
If so, when will that start because I can't have the computers randomly restarting during the day?

I can switch it back when we leave for the day (5pm'ish) but I know I will need to factor in replication time of the change to WSUS and when clients check in.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 38840046
Selecting Not Approved will prevent it from being installed however to remove it you need to Approve it for removal:

Approving updates for removal
You can approve an update for removal (that is, to uninstall an already-installed update). This option is available only if the update is already installed and supports removal. You can specify a deadline for the update to be uninstalled, or specify a past date for the deadline if you want to remove the update immediately (the next time client computers contact the WSUS server).

Note  
Not all updates support removal. You can see whether an update supports removal by selecting an individual update and looking at the Details pane. Under Additional Details, you will see the Removable category. If the update cannot be removed through WSUS, in many cases it can be removed with Add or Remove Programs from Control Panel.

If you are using WSUS to push updates out then it should already be set to not do updates/restarts durring the day.
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
LVL 9

Author Comment

by:samiam41
ID: 38840368
Under the additional details, there is the field Removable: No.

So I'm guessing this rules out WSUS?
0
 
LVL 26

Expert Comment

by:pony10us
ID: 38841003
I see that someone mentions that it can't be removed with WSUS now.  

Here is another method:   http://www.kolltveit.org/?p=514
0
 
LVL 9

Accepted Solution

by:
samiam41 earned 0 total points
ID: 38841017
Thanks pony10us.  That is one of the scripts I posted above but needed help with the proper syntax.  The question sort of morphed into removing IE9 with WSUS but the original idea was to get around the error message that continues to appear.

I was able to figure out the missing /switch and have just completed my second test.  I am using this script and launching it on the remote computers using PSTools.  I couldn't get the script to work with LANguard and I am going to devote my resources to the method that works.

FORFILES /P %WINDIR%\servicing\Packages /M Microsoft-Windows-InternetExplorer-*9.*.mum /c "cmd /c echo Uninstalling package @fname && start /w pkgmgr /up:@fname /quiet /norestart"

shutdown.exe /r /t 00 /f

Open in new window


I tested it on a hyper-v box and am moving it into our training lab for testing.  Thanks again for your help and attention to this question.  I hope we get to work together again in the near future.
0
 
LVL 26

Expert Comment

by:pony10us
ID: 38841067
Glad to hear you got it working.  So you were just missing the /quiet switch?
0
 
LVL 9

Author Comment

by:samiam41
ID: 38841077
I guess I was putting it in the wrong spot.  I tried after the command, on the same command line, etc, etc, etc....  I had the switch but I kept plugging it in the wrong spot.
0
 
LVL 9

Author Closing Comment

by:samiam41
ID: 38854317
I found the solution on my own but appreciate the assistance and suggestions provided by pony10us.
0

Featured Post

Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup" or a blinking cursor with black screen. A loop for Auto repair will start but fix nothing.  You will be panic as there are no back…
The Windows functions GetTickCount and timeGetTime retrieve the number of milliseconds since the system was started. However, the value is stored in a DWORD, which means that it wraps around to zero every 49.7 days. This article shows how to solve t…
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum editing capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question