Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Uninstalling Adobe and other programs

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Uninstalling Adobe and other programs
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1] 2   next >   >>
Login
Message << Older Topic   Newer Topic >>
 Uninstalling Adobe and other programs - 1/27/2005 2:44:07 PM   
  Rioku


Posts: 52
Score: 0
Joined: 1/27/2005
From:
Status: offline
Hello, and thank you in advance for anyone who helps
I am a little new so bare with me if this is very simple

1) This script right now is trying to uninstall Adobe 6.0 from the clients computer. I am unable to write a command like argument that works correctly to uninstall i.e. "/x" "/uninstall" and so on I have tried every combination I can come up with, no luck.

Here is the script is a rough form:


'****************** START CODE ***************************

Option Explicit


Dim UserName, adobe6folder, unInstall

Dim adobe6
'adobe6 = "C:\Documents%20and%20Settings\Pearce%20Aurigemma\Desktop\scripting\scripting\AdbeRdr60.exe /s /v /x"

adobe6 = "h:\AdbeRdr60.exe"

adobe6folder = "H:\Adobe\Acrobat 6.0"

Dim oFS
set oFS = WScript.CreateObject("Scripting.FileSystemObject")

Dim oShell
set oShell = WScript.CreateObject("WScript.Shell")


If (oFS.FolderExists(adobe6folder)) Then

' *** Adobe 6.0 exist "unInstall" will get 1 on OK, 2 on Cancle

unInstall = MsgBox ("Would you like to uninstall" & vbNewLine "Adobe 6.0 from this computer", 65, "Acrobat 6.0 Exists on this computer")

If (unInstall = 1) Then
oShell.Run "h:\AdbeRdr60.exe [UNINSTALL_ARGUMENT] "
else
Wscript.echo " you chose cancle"
End if


Else
Wscript.echo "Acrobat 6.0 Does not Exist on this computer"

End if


'*********** CLEAN UP **************

Set oFS = Nothing
Set oShell = Nothing



' ********** END CODE ****************

I commented out the fist adobe6 variable because I was unable to figure out what need to be put in place of the spaces, as you can see I tried %20 so I just moved to .exe to another drive


Thank you for you help
 
 
Post #: 1
 
 Re: Uninstalling Adobe and other programs - 1/27/2005 9:08:07 PM   
  Zifter


Posts: 318
Score: 0
Joined: 1/5/2005
From: Belgium
Status: offline
Here you can find an example of how to install/uninstall Acrobat reader with VBScript.

HTH

(in reply to Rioku)
 
 
Post #: 2
 
 Re: Uninstalling Adobe and other programs - 1/28/2005 7:52:19 AM   
  Rioku


Posts: 52
Score: 0
Joined: 1/27/2005
From:
Status: offline
#1 whatever you do do not try to make a post without logging in forst because I jsut lost about 20min of work because of it.

Now, sorry for not understanding the link you sent me but it is confusing to me. Because they say " The Acrobat Reader MSI need To on the target system". which I do not know if that means that Adobe needs to be install with the MSI or if I need to have an ADOBE.MSI on the computer

here is the code:

' Install or Uninstall based on switches passed to packaged
' executable If no switches (or if the script is not a
' packaged executable) an installation will be performed

Set oShell = CreateObject("WScript.Shell")
ASEEXEARGS = oShell.ExpandEnvironmentStrings("%ASEEXEARGS%")
WINDIR = oShell.ExpandEnvironmentStrings("%WINDIR%")
COMSPEC = oShell.ExpandEnvironmentStrings("%COMSPEC%")

If InStr("%ASEEXEARGS%","-u") <> 0 Then
' Uninstall Acrobat Reader
oShell.Run COMSPEC & " /c MsiExec.exe /X{AC76BA86-7AD7-1033-7646-A00000000001} /qn", 7, True
Else
' Install Acrobat Reader
oShell.Run "AdbeRdr60_enu.exe -p""-s /v\""/qn\""""", 7, True
' Note: there are many ways to trigger the silent installation,
' see http://www.appdeploy.com/packages for more information
Set FSO = CreateObject("Scripting.FileSystemObject")
fso.DeleteFolder(WINDIR & "\cache\adobe reader 6\")
Set FSO = Nothing
' While deleting these files will free space, if the files are needed in the
' future, the user will be prompted for their location. Calling the MSI from
' a network share may be best for usually-connected systems.
End If
oShell = Nothing

' This script has been successfully tested with alternate credentials specified
' in the ASE Script Packager. The Script Packager is a feature of the Admin Script
' Editor - http://www.adminscripteditor.com


what do these mean: %ASEEXEARGS% and %COMSPEC%



and the uninstall line:

oShell.Run COMSPEC & " /c MsiExec.exe /X{AC76BA86-7AD7-1033-7646-A00000000001} /qn", 7, True

what does the /c, MsiExec.exe, /X and the large number do?

thank you for the help

(in reply to Rioku)
 
 
Post #: 3
 
 Re: Uninstalling Adobe and other programs - 1/28/2005 12:15:21 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
%ASEEXEARGS% = environment variable that holds a value. If you do "echo %ASEEXEARGS%" from a DOS prompt, you might see the value it holds; however, I don't have that variable declared on my machine
%COMSPEC% = environment that holds the current command line interpreter. In 9x, it is "command.exe", and in NT+, it is "cmd.exe"
/C = argument for %COMSPEC% (cmd.exe if you using 2k/xp) that indicates the DOS session/window to be close after the exeecution of the command that follows it.
/X{GUID} = specifies a specific GUID for a object, in this case, its the unique GUID for Adobe Acrobat 6.0 (or whatever version this script is designed to remmove)

Hope this helps.

(in reply to Rioku)
 
 
Post #: 4
 
 Re: Uninstalling Adobe and other programs - 1/28/2005 6:59:16 PM   
  Rioku


Posts: 52
Score: 0
Joined: 1/27/2005
From:
Status: offline
OK Gentelmen I/we are very close to getting this finished
First I would like to thank everyone who had helped so far

So here is what I think the problem is The adobe product code is not the correct one and I am unable to locate others. Plus I also am in need of the others so that the script will completly erase all older versians of adobe. Again here is the code:

'****************** START CODE ***************************

Option Explicit


Dim UserName, adobe6file, unInstall

Dim adobe6
'adobe6 = "C:\Documents%20and%20Settings\Pearce%20Aurigemma\Desktop\scripting\scripting\AdbeRdr60.exe /s /v /x"
'adobe6 = "h:\AdbeRdr60.exe"

adobe6file = "C:\Program Files\Adobe\Acrobat 6.0 CE\Reader\AcroRd32.exe"

Dim oFS
set oFS = WScript.CreateObject("Scripting.FileSystemObject")

Dim oShell
set oShell = WScript.CreateObject("WScript.Shell")

Dim COMSPEC
COMSPEC = oShell.ExpandEnvironmentStrings("%COMSPEC%")


If (oFS.FileExists(adobe6file)) Then

' *** Adobe 6.0 exist "unInstall" will get 1 on OK, 2 on Cancle
unInstall = MsgBox ("Would you like to uninstall" & vbNewLine & _
"Adobe 6.0 from this computer", 65, "Acrobat 6.0 Exists on this computer")

If (unInstall = 1) Then
' oShell.Run "h:\AdbeRdr60.exe"
oShell.Run COMSPEC & " /c MsiExec.exe /X{AC76BA86-0000-0000-7760-7E8A45000000} ", 7, True
else
Wscript.echo " You Chose Cancle"
End if


Else
Wscript.echo "Acrobat 6.0 Does not Exist on this computer"

End if

' AC76BA86-7AD7-1033-7646-A00000000001

' oShell.Run installCmd,1, TRUE

' oShell.Run "\\ds1\c\adobe7.0.exe /s /v/qn"




'*********** CLEAN UP **************

Set oFS = Nothing
Set oShell = Nothing

WScript.Quit (0)

' ********** END CODE ****************


The error it returns is "This action is only valid if the product is currently installed" I do have adobe 6.0 CE installed.
So I have come to the conclusion that the codes that I tried are not the ones that I need and a search on Adobe's site for "product code" nothing also same result on google.

thanx for the help I can not wait to be able to post the completed script

(in reply to Rioku)
 
 
Post #: 5
 
 Re: Uninstalling Adobe and other programs - 1/28/2005 7:19:25 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Try searching for any relavent keys under HKEY_LOCAL_MACHINE\Software\Adobe and see if you can find the GUID for your installed version of adobe product. Also search the folder where it is installed, look for uninstall.* or *.log that might have uninstall string inside.

(in reply to Rioku)
 
 
Post #: 6
 
 Re: Uninstalling Adobe and other programs - 1/29/2005 9:51:06 AM   
  Rioku


Posts: 52
Score: 0
Joined: 1/27/2005
From:
Status: offline
Hey,
Just wanted to say thanx. I got all the parts that I need working I will post the final script when I am done. Hopefully it will help someone. Thanx again

(in reply to Rioku)
 
 
Post #: 7
 
 Re: Uninstalling Adobe and other programs - 1/30/2005 6:52:57 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
No problem, hopefully it helps.

(in reply to Rioku)
 
 
Post #: 8
 
 Re: Uninstalling Adobe and other programs - 2/1/2005 3:11:12 PM   
  Rioku


Posts: 52
Score: 0
Joined: 1/27/2005
From:
Status: offline
I am trying to read the 5th line of a file with the object.readline how do I get it to move down the the fith line.

then after I have it in a variable I want cut off the first 8 characters is there a function for that?

(in reply to Rioku)
 
 
Post #: 9
 
 Re: Uninstalling Adobe and other programs - 2/1/2005 3:21:15 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Everytime ReadLine method is called, it will read the next line in the file so it's necessary to assign a variable to object.ReadLine if you want to do more comparison or manipulate the otuput of object.ReadLine.

To get everything after the 8th characters (if I read you correct), simply do

temp = "12345abced"
temp = Right(variable,len(variable)-8)

temp will become "ed"



Hope this helps.

(in reply to Rioku)
 
 
Post #: 10
 
 Re: Uninstalling Adobe and other programs - 3/10/2005 5:44:16 AM   
  jefdotmil

 

Posts: 1
Score: 0
Joined: 3/10/2005
From:
Status: offline
To uninstall Adobe Acrobat 6.0 and install 7.0 :

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colSoftware = objWMIService.ExecQuery _
("Select * from Win32_Product Where Name = 'Adobe Reader 6.0'")
wshshell.popup "Pausing 30 seconds to allow Adobe Acrobat 6.0 to uninstall",30",Uninstall previous version",vbInformation+vbOKOnly
For Each objSoftware in colSoftware
objSoftware.Uninstall()
Next

Set WshShell = CreateObject("Wscript.Shell")
wshshell.popup "Now installing Acrobat Reader 7.0",5",Installing new version",vbInformation+vbOKOnly
WshShell.Run "AdbeRdr70_enu_full.exe /S /v/qn"
WSCRIPT.QUIT

(in reply to Rioku)
 
 
Post #: 11
 
 Re: Uninstalling Adobe and other programs - 3/10/2005 5:48:09 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Good point, didn't think of that :)

Thanks

(in reply to Rioku)
 
 
Post #: 12
 
 Re: Uninstalling Adobe and other programs - 3/10/2005 10:54:36 AM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
gents,

i would not recommend adding "pauses" or sleeps while uninstalling or installing products, especially if these products i.e. adobe are msi's.

you might be installing / uninstalling these products on different hardware spec's that might take longer to uninstall / install.

probably a safer bet to check the registry when the product is installed.

also, to completely remove old products (msi's that is, running /x switch often is not enough.)

take a look at a utility called "msizap" in the windows installer sdk which strips every last bit of the old product off the machine just to make sure, including msi cached information etc.

also take a look at
http://www.visualbasicscript.com/topic.asp?TOPIC_ID=2052

Bushmen

(in reply to Rioku)
 
 
Post #: 13
 
 Re: Uninstalling Adobe and other programs - 3/10/2005 1:24:45 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
I don't understand why there is a need to pause, but then again, I didn't actually test those scripts. Just didn't think of looking for possible classes that could do the same thing. However, its effectiveness remains to be seen.

I'll check out msizip you talked about; seems fun :)

(in reply to Rioku)
 
 
Post #: 14
 
 Re: Uninstalling Adobe and other programs - 3/11/2005 1:02:55 AM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
No problems,

Also, I just thought of something...

Normally in my script, when i'm uninstalling msi's, I use a function like thie:

=====================================
Function ShellandWait(szCommandLine)

On Error Resume Next 'only use these for my error checking
objShell.Run szCommandLine,1,TRUE
On Error Goto 0 'only use these for my error checking

End Function
======================================

Then I simply parse my commandline (example: msiexec /x {ProductCode} /qn})


This works a treat, so that you wait for the exit code of every msi session,
so that you know exactly when the application is uninstalled.

Regards,

Bushmen

(in reply to Rioku)
 
 
Post #: 15
 
 Re: Uninstalling Adobe and other programs - 3/11/2005 1:18:00 AM   
  tnoonan

 

Posts: 364
Score: 0
Joined: 12/14/2004
From:
Status: offline
You can do this

c:\winnt\IsUninst.exe -fC:\yourprogram\xxxx.isu -a

(in reply to Rioku)
 
 
Post #: 16
 
 Re: Uninstalling Adobe and other programs - 3/11/2005 8:03:05 AM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
Some might not like this (for reasons unknown to me), but if we use GPO for all of our software deployments and it works well. We don't often have problems with uninstalling a specific software because when the boxes fall outside the management scope, it is removed automatically (or when we remove the specific deployment).

Of course, if you are in a workgroup, I guess that's the only way to automate this part of the software management process. If I have 10-15 computers within the workgroup, I would probably just do it manually instead of scripting for it unless it's a repeated task which I'll try to avoid (if possible) =)

Oh well, just some Friday ranting =)

(in reply to Rioku)
 
 
Post #: 17
 
 Re: Uninstalling Adobe and other programs - 3/11/2005 12:14:37 PM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
gents,

you'ld probably find in big organizations with application repackaging teams, that all uninstall, and isu files and information which gets put down with the installation gets removed when you repackage the msi or on install, since the msiexec windows installer service can take care of this much more effectively and efficiently.

another reason is so that the user can not be tempted to try anything fancy, like uninstalling a package via the command line or shortcuts.. users are getting clever these days and even though machines gets locked down, users gets around it.

with the msi repair capabilities, the user can do pretty much anything to the install, and the msi should be able to repair, unless of course the user unistall the product, where the won't be possible.

Bushmen

(in reply to Rioku)
 
 
Post #: 18
 
 Re: Uninstalling Adobe and other programs - 3/11/2005 2:57:52 PM   
  token

 

Posts: 1917
Score: 0
Joined: 1/14/2005
From:
Status: offline
You mean GP Software Deployment repair capabilities perhaps ? Yes, that's what is been primarily used in our environment. Of course, depends on the level security requirements and the degree of lockdown of a machine, users might find ways to circumvent the rules in place, though we don't usually have this kind of problem.

After all, if they break their machines, they are no longer able to work and therefore won't be able to fullfill their job requirements, especially for the sales poepole. They depend on computers =)

(in reply to Rioku)
 
 
Post #: 19
 
 Re: Uninstalling Adobe and other programs - 3/12/2005 7:54:23 AM   
  Bushmen

 

Posts: 122
Score: 0
Joined: 2/4/2005
From:
Status: offline
maybe the users in the US are less violent to their pc's
than in the UK

bushmen



(token, i am quite interested in your regular expression post,..
have you find an answer yet?)

(in reply to Rioku)
 
 
Post #: 20
 
 
Page:   [1] 2   next >   >>
 
  

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 >> Uninstalling Adobe and other programs Page: [1] 2   next >   >>
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