Quick test professional

QTP Tips QTP codes QTP Faqs and more

Uninstall a software using vbscript , QTP

This works for uninstalling most applications. In this example I will show how AutoCAD 2005 can be uninstalled using a VBScript. Open Regedit and look in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall search for the application and find a the product code that is in GUID format looking like this: {5783F2D7-0301-0409-0002-0060B0CE6BBA} It might be something else for you. The code below will uninstall AutoCAD 2005 as well as Express Tools. Copy the code below into Notepad and give the file the extension vbs.on error resume next
Set WshShell = CreateObject("WScript.Shell")
' Uninstall Express Tools
WshShell.Run "msiexec /x {5783F2D7-0311-0409-0000-0060B0CE6BBA} /q",1,true
' Uninstall AutoCAD 2005
WshShell.Run "msiexec /x {5783F2D7-0301-0409-0002-0060B0CE6BBA} /q",1,true

Reference:JTBWorld blog


February 20, 2008 - Posted by | Uninstall a software using QTP, Uninstall a software using vbscript


  1. Hi,

    i need to uninstall the s/w using vb script, but i am not able to find the GUID of my application. I have win7 62 bit machine, can you please let me know how can i do it it will be a great help.


    Comment by usha | July 7, 2011 | Reply

  2. The more generalised vbscript for uninstalling will be
    Set WshShell = CreateObject(“WScript.Shell”)
    pathUninstall = “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\{FB25972D-C14D-4050-9EF6-4F9DF8845DC0}\UninstallString”
    strUninstall = WshShell.RegRead(pathUninstall)
    WshShell.Run strUninstall

    Comment by Tathagata Saha | October 16, 2015 | Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: