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
LVL 3
ivan rosaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Hi Ivan,

Is there a reason why you need it as a batch script ? You could also perhaps try PowerShell like the below script

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

Open in new window

These will also get you started
Batch Remove MSI Applications on local/remote computer
or
Powershell: Uninstall software on remote computer
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ivan rosaAuthor Commented:
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... :|
0
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Hi Ivan,

No problem at all, then the first link i sent should get you started
0
The IT Degree for Career Advancement

Earn your B.S. in Network Operations and Security and become a network and IT security expert. This WGU degree program curriculum was designed with tech-savvy, self-motivated students in mind – allowing you to use your technical expertise, to address real-world business problems.

ivan rosaAuthor Commented:
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"
0
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
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
0
ivan rosaAuthor Commented:
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?
0
Greg BessoIT Solutions EngineerCommented:
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
0
ivan rosaAuthor Commented:
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...
0
Greg BessoIT Solutions EngineerCommented:
first try the wmi get with just returning the list. make sure your returned items list the one you are looking to remove. i also had the where in quotes but it looks like you changed it a bit and are also using match instead of like. not familiar with that only used this one way in the past...
0
ivan rosaAuthor Commented:
wmic product where name like 'notepad++%' call uninstall /noninteractive

Open in new window


"like - invalid alias verb."

still did not work
0
Leon TaljaardSystem Center Specialist - ArchitectureCommented:
Hi Ivan,

The script works but for some reason it doesnt return "Notepad++" even if i try -like "Notepad%" and if i try run the following command

Get-WmiObject Win32_Product

Open in new window


It doesnt show up in the list, but if i use another application it works perfectly
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.