Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > VB Script

Vista - Re: Uninstall application script

Reply
 
Old 06-03-2009   #1 (permalink)
Richard Mueller [MVP]


 
 

Re: Uninstall application script


"Gary" <Gary@xxxxxx> wrote in message
news:BA08B7B7-7D59-4310-975B-BC45848AF6D0@xxxxxx
Quote:

> Hello,
>
> I am using the below script to uninstall an application:
>
> Dim shell, systempath
> set shell = WScript.CreateObject( "WScript.Shell" )
> systempath = shell.ExpandEnvironmentStrings("%SystemRoot%")
> shell.Run Chr(34) & systempath & "\system32\msiexec.exe" & Chr(34) & " /x
> {2F1A8F7C-0C38-464B-A61B-32C7F7AEAD9F}"
> WScript.Quit
>
> When I invoke this, i get a prompt "Are you sure you want to uninstall
> this
> product?"
> with the Yes and No buttons.
>
> Is there a way I can customize this text to put in the application name in
> place of "this product" in the above msg. Also, is it possible to place
> an
> icon in this message?
>
>
msiexec.exe has a /quiet parameter. If you specify this it runs in quiet
mode with no user interaction. You could then display your own message using
the MsgBox method, which has options for title, buttons, and icons. For
example:
==========
Dim objShell, strPath, strCmd, Response
Set objShell = CreateObject("Wscript.Shell")
strPath = objShell.ExpandEnvironmentStrings("%SystemRoot%")
strCmd = "%comspec% /c """ & strPath & "\system32\msiexec.exe"" /quiet /x
{2F1A8F7C-0C38-464B-A61B-32C7F7AEAD9F}"
Response = MsgBox("Are you sure you want to uninstall my application?",
vbYesNo + vbInformation, "My Title")
If (Response = vbYes) Then
objShell.Run strCmd, 2
End If

Check VBScript/WSH documentation on the MsgBox function and the button and
icon options available, such as: vbOKOnly, vbYesNoCancel, vbQuestion,
vbExclamation, vbCritical, etc:

--
Richard Mueller
MVP Directory Services
Hilltop Lab - http://www.rlmueller.net
--



My System SpecsSystem Spec
Old 06-04-2009   #2 (permalink)
Gary


 
 

Re: Uninstall application script

Thanks Richard. The "/qb" option worked for me.

"Richard Mueller [MVP]" wrote:
Quote:

>
> "Gary" <Gary@xxxxxx> wrote in message
> news:BA08B7B7-7D59-4310-975B-BC45848AF6D0@xxxxxx
Quote:

> > Hello,
> >
> > I am using the below script to uninstall an application:
> >
> > Dim shell, systempath
> > set shell = WScript.CreateObject( "WScript.Shell" )
> > systempath = shell.ExpandEnvironmentStrings("%SystemRoot%")
> > shell.Run Chr(34) & systempath & "\system32\msiexec.exe" & Chr(34) & " /x
> > {2F1A8F7C-0C38-464B-A61B-32C7F7AEAD9F}"
> > WScript.Quit
> >
> > When I invoke this, i get a prompt "Are you sure you want to uninstall
> > this
> > product?"
> > with the Yes and No buttons.
> >
> > Is there a way I can customize this text to put in the application name in
> > place of "this product" in the above msg. Also, is it possible to place
> > an
> > icon in this message?
> >
> >
>
> msiexec.exe has a /quiet parameter. If you specify this it runs in quiet
> mode with no user interaction. You could then display your own message using
> the MsgBox method, which has options for title, buttons, and icons. For
> example:
> ==========
> Dim objShell, strPath, strCmd, Response
> Set objShell = CreateObject("Wscript.Shell")
> strPath = objShell.ExpandEnvironmentStrings("%SystemRoot%")
> strCmd = "%comspec% /c """ & strPath & "\system32\msiexec.exe"" /quiet /x
> {2F1A8F7C-0C38-464B-A61B-32C7F7AEAD9F}"
> Response = MsgBox("Are you sure you want to uninstall my application?",
> vbYesNo + vbInformation, "My Title")
> If (Response = vbYes) Then
> objShell.Run strCmd, 2
> End If
>
> Check VBScript/WSH documentation on the MsgBox function and the button and
> icon options available, such as: vbOKOnly, vbYesNoCancel, vbQuestion,
> vbExclamation, vbCritical, etc:
>
> --
> Richard Mueller
> MVP Directory Services
> Hilltop Lab - http://www.rlmueller.net
> --
>
>
>
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
how can I uninstall an application from multiple PC's? PowerShell
Script for Uninstall Access 2002 VB Script
How to uninstall stubborn (or corrupt) application? Vista General
Cannot uninstall any application thru Programs and Features of Vis Vista installation & setup
Uninstall an application using Powershell PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46