SyntaxHighlighter.config.bloggerMode=true; SyntaxHighlighter.all();

Friday, April 29, 2011

How to remove software using VBS Script

Isn't it a pain when you need to uninstall unwanted software from your computer but it does not let you? Or what about the IT folks that need to uninstall an app from many of the client machines they have on their enterprise? Would they do it manually on each computer?

There are several ways to accomplish this task without having to spend hours uninstalling the app machine per machine.

This time I'll show you how to uninstall software, (Winzip on a Windows OS computer) using VBS script. All VBS code found on this site needs to be copied and pasted on a notepad file and saved with the extension .vbs

'Created by
'each line next to the quote won't be ran when you execute the script since it's just a comment.
'In this

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'Winzip'")

For Each objSoftware in colSoftware

This script should work though you don't see the program listed under Add/Remove programs since it depends WMI and the Windows Registry.


Post a Comment

Content belongs to All Rights Reserved. Powered by Blogger.