script to uninstall

i need a script to uninstall the "metaframe presentation server web client for win32".  the version is 9.00. i have a tool called inca from gourami that installs all installed productes form the clients. we have clients installed by multiple citrix clients like ica client, pasword manager, consoles, admin tools. i want to be able to uninstall only the ica web client and as a continuation of the script i want a new version of the client to be installed for example from a shared folder.

the script should first uninstall only the web client and then install a new client (.msi) from a shared folder.

need either a batch file or vb script that can do this please. the name of the client in he attached file
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi there, this script should read the registry value to obtain the uninstallstring, and then uninstall it if it exists.

Then you can point the \\Server\Software\Citrix\WebClient\ica32web.msi to the MSI of your new client, and it should install that too.


Set objShell = CreateObject("WScript.Shell")
On Error Resume Next 
strUninstallString = objShell.RegRead("HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\MetaFrame Presentation Server Web Client for Win32\UninstallString")
If Err.Number = 0 Then
	boolOldClientFound = True
	boolOldClientFound = False
End If
On Error Resume Next
If boolOldClientFound = True Then intReturn = objShell.Run(strUninstallString, 1, True)
strCommand = "msiexec /i \\Server\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No"
objShell.Run strCommand, 1, True

Open in new window

mgmohiuddinAuthor Commented:
thanks Rob

BUt the script is asking for a confirmation before removing the client, like " this will uninstall web client click yes or no". secondly it is desplaying a message the cleint has been removed. we want it to be as transparent as possible. the user should not even know that we have upgraded his client. if we give a choice to a user we cannot be sure he will do as intended.
Hmmm, I can't find the old MSI for version 9, but can you run
MSIExec /X C:\ica32.msi /qn

where c:\ica32.msi points to the version 9 msi?

mgmohiuddinAuthor Commented:
NO dosent work

now i know it is a different question all to gether. if you want i could close this one a post a new question. we tested these options and are not meeting our needs as we want our deployment/upgrade to be phased and login script and GPO is not meeting our requirements

the management wants us to use SCCM to deploy and the sequence should be as follows

1. display a message to the user that his client is being upgraded and close all ica sessions
2. for people who do not close kill the ica session
3. make sure de does not reopen it by blocking 3 url's from where he can open a new session
4. upgrade the client using silent install
5. unblock the 3 blocked url's

all te clients open citrix applications using web interface and ica files on the portal. thats why we want to block the url's for the time of the upgrade

please need this script urgent as we need  ot test it today  and provide the feedback of the results.
OK, so to uninstall version 9, you can run this batch file as a StartUp script, so that you know that no programs are open at the time.

@echo off
reg query "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Metaframe Presentation Server Web Client for Win32" /v UninstallString
if errorlevel = 1 goto END
C:\PROGRA~1\Citrix\icaweb32\wfica32.exe /unregserver
rd /s /q C:\Windows\System32\Resource
rd /s /q "C:\Program Files\Citrix\icaweb32"
del /q C:\WINDOWS\system32\ctxsetup.exe
reg delete "HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall\Metaframe Presentation Server Web Client for Win32" /f

What I have done there is examine the uninst.inf file that it would otherwise use, and basically just manually do everything that it would do anyway.

Then, once the version 9 client has been uninstalled, you could just use the Presentation Server Web Interface to deploy your new client.  We are using version 11, and users are able to download and install it to their own user profile without requiring admin rights.
The install prompt for the new client is provided automatically when the Web Interface determines the client is not the required version.

Alternatively, if you wanted to have the StartUp script install it, you could add
msiexec /i \\Server\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No

to the end of the batch file, provided that you change \\server\software to a location that is in your NetLogon share of your domain controller, such as
msiexec /i \\\SysVol\\scripts\Software\Citrix\WebClient\ica32web.msi /qn ENABLE_DYNAMIC_CLIENT_NAME=Yes ENABLE_SSON=Yes ALLOW_REBOOT=No



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.