Solved

I need a VB script that will uninstall configuration manager agent......will be deploying through logon

Posted on 2008-10-16
11
554 Views
Last Modified: 2010-04-21
I need a VB script that will uninstall Microsoft configuration manager 2007 agent......will be deploying through logon using GPO.   Please help!!!
0
Comment
Question by:ln733
  • 6
  • 4
11 Comments
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22734696
You need to find out the GUID for the application and run a MSIEXEC /X {GUID} /qb to uninstall.

Look in the registry

HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall

When you find it locate the UninstallString

Add the /qb to make it a silent uninstall.
0
 

Author Comment

by:ln733
ID: 22736115
Any other suggestions?
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22736135
Did you locate the Uninstall String?

Create a .bat and apply with the GPO. Logon if your users are administrators of their workstation otherwise use Machine Startup GPO.
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:ln733
ID: 22736160
The problem with the bat file is that the command prompt is visible to the user when they logon to the machine.   It doesnt close to it has finished unistalling which could take 5 minutes.
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22736220
Once you find the uninstall string you can use it in VBS.

Set objShell = CreateObject("Wscript.Shell")
 
ret = objShell.run("MSIEXEC.exe /QB /X " + chr(34) + "{GUID}" + chr(34))

Open in new window

0
 
LVL 65

Expert Comment

by:RobSampson
ID: 22736242
In733, welcome to EE.

AT's suggestion to find the Uninstall string is valid.....and would help us know what command we need to run to have it uninstalled....

However, as an alternative, you could try this script, which may return a result if the Configuration Manager can be found in the Win32_Product class.

If it can (that is, if you do get some information from this script), then you would be able to invoke the Uninstall method for that product.

Regards,

Rob.
If LCase(Right(Wscript.FullName, 11)) = "wscript.exe" Then
    strPath = Wscript.ScriptFullName
    strCommand = "%comspec% /c cscript  """ & strPath & """"
    Set objShell = CreateObject("Wscript.Shell")
    objShell.Run(strCommand), 1, True
    Wscript.Quit
End If
 
On Error Resume Next
 
Const wbemFlagReturnImmediately = &h10
Const wbemFlagForwardOnly = &h20
 
strComputer = "."
 
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery("SELECT * FROM Win32_Product Where Name LIKE 'Microsoft Configuration%'", "WQL", _
                                       wbemFlagReturnImmediately + wbemFlagForwardOnly)
 
For Each objItem In colItems
   WScript.Echo "Caption: " & objItem.Caption
   WScript.Echo "Description: " & objItem.Description
   WScript.Echo "IdentifyingNumber: " & objItem.IdentifyingNumber
   WScript.Echo "InstallDate: " & objItem.InstallDate
   WScript.Echo "InstallLocation: " & objItem.InstallLocation
   WScript.Echo "InstallState: " & objItem.InstallState
   WScript.Echo "Name: " & objItem.Name
   WScript.Echo "PackageCache: " & objItem.PackageCache
   WScript.Echo "SKUNumber: " & objItem.SKUNumber
   WScript.Echo "Vendor: " & objItem.Vendor
   WScript.Echo "Version: " & objItem.Version
   WScript.Echo
Next

Open in new window

0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22736247
Oh you probably want /qn.
0
 

Author Comment

by:ln733
ID: 22745532
Sorry guys....this is way over my head.   To put it simple, I need to run this command "Ccmsetup.exe /uninstall" either in a bat file or vb script.  The problem with the bat is that it leaves the command line box open for the user to see when the logon.  
0
 
LVL 21

Accepted Solution

by:
AmazingTech earned 500 total points
ID: 22745662
You might need to put the full path to where ccmsetup.exe is residing.
Set objShell = CreateObject("Wscript.Shell")
 
ret = objShell.run("Ccmsetup.exe /uninstall")
 

Open in new window

0
 

Author Closing Comment

by:ln733
ID: 31506868
Thanks!
0
 
LVL 21

Expert Comment

by:AmazingTech
ID: 22746085
Thanks. Glad it worked out. A more generic uninstall for MSI apps is what I was leaning towards. So keep it in mind for other uninstalls.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Excel 2016 loop through 6 35
server core and windows updates 3 38
parental control on huwei HG658b 1 18
Slow Restore if incremental backups using RDiff.exe 4 17
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
While rebooting windows server 2003 server , it's showing "active directory rebuilding indices please wait" at startup. It took a little while for this process to complete and once we logged on not all the services were started so another reboot is …
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question