[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2446
  • Last Modified:

uninstalling multiple applications?

Hi all,

I'm trying to uninstall multiple applications on a computer and looking for a way to automate it.  Does anyone know how i can achieve this?

There must be a application out there and ive seen some WMI script to work with powershell but my powershell scripting isnt quite there yet.

$app = Get-WmiObject -Class Win32_Product `
                     -Filter "SELECT * FROM Win32_Product WHERE Name = 'Software Name'"
0
resolver1
Asked:
resolver1
  • 5
  • 3
  • 3
  • +1
1 Solution
 
jcimarronCommented:
resolver1--This program will allow you to uninstall multiple applications if you turn on Advanced Mode
http://www.nirsoft.net/utils/myuninst.html
And this reference says Easy Uninstaller will do it, but I am not certain it works on Win 7.
http://www.ehow.com/how_7516750_uninstall-multiple-programs-same-time.html
0
 
Neil RussellTechnical Development LeadCommented:
Reference you query for Powershell, you need a like like this....

$app = Get-WmiObject -query "Select * from win32_product WHERE Name Like '%Microsoft%'"

That will return ALL products with Microsoft in the Product Name. Note the use of % and not * in the query for Wild Cards
0
 
Neil RussellTechnical Development LeadCommented:
The following would attempt to uninstall ALL Products with the word Microsoft in its name. (Don't try it ;) )


$app = Get-WmiObject -query "Select * from win32_product WHERE Name Like '%Microsoft%'"
foreach ($Application in $App ) { msiexec /uninstall $Application.IdentifyingNumber }
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
jcimarronCommented:
resolver1--Script to accomplish what you want is a little more complicated.  But is a start
http://www.symantec.com/connect/downloads/uninstall-windows-installer-applications-using-vbscript
Read the comments as well.
0
 
resolver1Author Commented:
Thanks for the replies guys .  By the looks of it (correct me if im wrong)  all the scripts will only un-install one application.  I need something that will cycle through a list.  

If you try and un-install 2 programs at once Windows says MSI can only remove one program at once.

easy remove looks good but you have to install it first, i was looking for something that doesnt need installing first so i can script it.  

Thanks
0
 
jcimarronCommented:
resolver1--
From my first post "This program will allow you to uninstall multiple applications if you turn on Advanced Mode"  this refers to http://www.nirsoft.net/utils/myuninst.html
0
 
Neil RussellTechnical Development LeadCommented:
No you are wrong..

 
$app = Get-WmiObject -query "Select * from win32_product WHERE Name Like '%Microsoft%'"
foreach ($Application in $App ) { msiexec /uninstall $Application.IdentifyingNumber }

Open in new window


The clue is in the ForEach statement. That will itterate through every program that is installed that matches your wmi SELECT query. USE WITH CARE.  You could, as with any wildcard, uninstall more than you intend to
0
 
resolver1Author Commented:
Thanks for your help so far!

nirsoft : I ran Nirsoft, switch advanced mode and received about 15 windows saying:

 Error uninstalling apps
It also ask me questions about uninstalling, i want it to be a silent un-install.

The powershell code is probably more powerful to me because i can add it to a existing script i am using. How can i read a list of programs from a text file (which i will create before i run the powershell script) and run through and un-install each application?
0
 
resolver1Author Commented:
I've tried this PowerShell script and it works with one app but i've not tested it with multiple apps.  Ill let you guys know.  

$App = Get-Content "C:\temp\un-installApp.txt"
gwmi win32_product| where { $App -contains $_.Name }| foreach { $_.Uninstall() }

Thanks
0
 
resolver1Author Commented:
Just to update you guys on the latest script which uninstalls all applications silently:

 
$ArgumentsStandard =" /quiet "
$ArgumentsStandard +="/norestart"
$App = Get-Content "C:\temp\un-installApp.txt"

#gwmi gets the list of applications 
# where selects just the apps im interested in removing 
# start-process removes each app using msiexec with quiet and norestart options 

Write-Host "start un-installing software from list"
gwmi win32_product | 
where { $App -contains $_.Name } |
ForEach-Object {
	Write-Host "start un-installing $_.name"
	$Arguments =  "/uninstall "
	$Arguments += $_.IdentifyingNumber
	$arguments += $ArgumentsStandard 
	Start-Process "MSIExec" -ArgumentList $Arguments -wait
}

Open in new window

0
 
LeeTutorretiredCommented:
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0
 
resolver1Author Commented:
Sorry for the delay in getting back to this post.  I couldnt get the script to work for all the programs.  I was hoping to get back to it but ive been too busy.  Sorry.
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now