Link to home
Start Free TrialLog in
Avatar of ivan rosa
ivan rosaFlag for United States of America

asked on

Removing applications Windows

Hello colleagues,

Is there any common syntax/command to remove already installed an application from Windows using DOS, furthermore to be implemented in a batch script for multiple PCs?

Ps. application shows in the ADD/REMOVE  catalog within settings
ASKER CERTIFIED SOLUTION
Avatar of Leon Taljaard
Leon Taljaard
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ivan rosa

ASKER

Hello Leon,

Thanks for your quick response, but I rather work with batch files because it's a lot easier to understand them, not to mention the small fact that I don't know how to setup PS execution policies...-last time it I tried I ended it up not able to run any kind of commands and I ended reimaging my PC... :|
Hi Ivan,

No problem at all, then the first link i sent should get you started
I did check that at first, but noticing the layout and commands I know it's a PS script and the line 21   "This script requires powershell 3.0"
Ok no problem only noticed that now.

Have you perhaps had a look at this

Create uninstall script/batch to remove multiple programs with GUIDd
I Checked the link however it shows

msiexec.exe /uninstall {90840409-6000-11D3-8CFE-0150048383C9} /quiet

how would I know an " X " application would be equal to?
One way, which is kind of scary, is to use WMIC calls with the right filter to only pluck the item you want to remove. IT's scary in that if you run it wrong, you might go and try to remove everything.

wmic product where "name like 'Java%' and not name like 'Java 8 Update 45%'"  call uninstall /nointeractive

That is just an example that will uninstall Java installs that are not version 8 update 45. At the time it was used to remove older versions while we were installing version 8 update 45 :P
Hello All, As much as I would it love to get this going in BATCH script, it would look like I had to go for like a VBS or PS1 option... so,

Leon,
I tried this

$app = Get-WmiObject -Class Win32_Product | Where-Object { 
        $_.Name -match "Notepad++" 
        }
    
        $app.Uninstall()

Open in new window


and did this on the PS1 console
".\nameofscrip.ps1"

Open in new window

and it didn't do anything but jump in the next prompt command

then I did the WMIC command and that was also a no go...
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
wmic product where name like 'notepad++%' call uninstall /noninteractive

Open in new window


"like - invalid alias verb."

still did not work
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial