Windows – How to uninstall software using batch file

batch-filepowershelluninstallwindowswmi

I want to uninstall a software by calling a bat file. It must be automatically, without entering any parameters during the uninstallation.
How to make the bat file which would be able to uninstall software by name?

PS: I know the perfect method using WMI, but it requires user input:

WMIC
product where name="software" call uninstall

Best Answer

I think WMIC commands can be run from a single line which should make it easier to add to a batch file. And by adding /nointeractive then it should disable prompting as well. Try something like this:

wmic product where name="software" call uninstall /nointeractive