Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


uninstall software

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,50991
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> uninstall software
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 uninstall software - 8/21/2007 1:23:34 AM   
  360bart

 

Posts: 2
Score: 0
Joined: 8/21/2007
Status: offline
Basically I have a project to uninstall seven software programs for 85  laptop users and believe a vb script would be best.
Unless I have a script, I will have to uninstall, and install software manually.

I started w/e.g.  msiexec /x {77777777-1111-2222-0000-000000000000}, but for each software program, the GUID is unique.
The software was installed from a server, and the MSI files are located there, so I maybe I would have to include  the \\servername\softwarefolder\MSI files??

Here is what I found from another site:

on error resume next
Set WshShell = CreateObject("WScript.Shell")
' Uninstall SoftwareNameHere
WshShell.Run "msiexec /x {77777777-1111-2222-0000-000000000000} /q",1,true
' Uninstall SoftwareNameHere
WshShell.Run "msiexec /x {77777777-1111-2222-0000-000000000000} /q",1,true
' Uninstall SoftwareNameHere
WshShell.Run "msiexec /x {77777777-1111-2222-0000-000000000000} /q",1,true

Any help would be great.
Thanks
 
 
Post #: 1
 
 RE: uninstall software - 8/21/2007 2:02:11 AM   
  LANlazy

 

Posts: 82
Score: 0
Joined: 4/11/2007
Status: offline
Give this a try.  Create softwaregone.txt file with all computer names with no slashes.  Save text file in same location as scriptname.vbs.  Change Symantec Antivirus 10.0.2011.2 to whatever the name of the software program is.  Use cscript scriptname.vbs softwaregone.txt from cmd and it should work.  I dont know about the missing .msi packages.  If it wont uninstall then maybe you should look into Windows Installer Cleanup Utility.

On Error Resume Next
softwaregone = wscript.arguments(0)
set onet = createobject("wscript.network")
set ofs = createobject("scripting.filesystemobject")
set oipFile = ofs.opentextfile(softwaregone, 1, false)
if (Err.Number <> 0) then
    wscript.echo "Cannot open " & ipFile
   
else
while not oipFile.atEndOfStream
    strComputer = oipFile.ReadLine()
    wscript.echo vbCrLf & "Connecting to " & strComputer & "..."
           Set objService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
           if (Err.Number <> 0) then
            wscript.echo "Failed to connect to " & strComputer & "."
On error resume next                         
 else
Set objWMIService = GetObject("winmgmts:" _
   & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colSoftware = objWMIService.ExecQuery _
   ("Select * from Win32_Product Where Name = 'Symantec Antivirus 10.0.2011.2'")
For Each objSoftware in colSoftware
   objSoftware.Uninstall()
Next
End If
wend
End If

(in reply to 360bart)
 
 
Post #: 2
 
 RE: uninstall software - 8/21/2007 2:29:06 AM   
  CondoPC


Posts: 118
Score: 0
Joined: 7/23/2007
Status: offline
If you are sure the MSI used to install the software is the same as the one you have, you can refrence that file  in the uninstall string instead of the GUID.

msiexec /x <path to msi> /qb!

(in reply to 360bart)
 
 
Post #: 3
 
 RE: uninstall software - 8/22/2007 12:12:32 AM   
  360bart

 

Posts: 2
Score: 0
Joined: 8/21/2007
Status: offline
Thank you for the reply's.

I believe I have a script that will work.

I'm trying to suppress the reboot after each line, but could not get it to work. Where should I add the REBOOT=ReallySuppress to the line below? And is this the best option?

WshShell.Run "msiexec /x {0B1774B2-3A08-4780-B13A-D401D2945208} /q",1,true
 
After all of the uninstalls complete, then I want to run a reboot.
 

WshShell.Run "C:\WINDOWS\system32\shutdown.exe -r -t 0"   <<<------could not get this to work for 2000
 
Thanks again!

(in reply to CondoPC)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> uninstall software Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts