Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleUninstall a program
DescriptionThis example shows how to uninstall a program in Visual Basic 6. It uses the st6unst.exe program, passing it the log file created during program installation.
Keywordsuninstall, deinstall, uninstallation
CategoriesSoftware Engineering
 
Use the st6unst.exe program (VB6) in the Windows directory, passing is the log file created during program installation.

To use this example, build an installation package for program Test using the Package and Deployment Wizard. Install the program and run it.

Then run program Uninstall. Tell it where to find the log file created during the installation.

Program Uninstall uses the following code to run program st6unst.exe in the Windows directory.

 
Private Sub Command1_Click()
    Shell WindowsDirectory() & _
        "\st6unst.exe -n """ & _
        Text1.Text & """"
End Sub

' Return the windows directory.
Private Function WindowsDirectory() As String
Dim buf As String * 256
Dim return_len As Long

    return_len = GetWindowsDirectory(buf, Len(buf))
    WindowsDirectory = Left$(buf, return_len)
End Function
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated