Batch Script Issue Question

robertarenson
robertarenson used Ask the Experts™
on
The script works fine up to the point where it is suppose to launch the installation process, it is not launching the CitrixReceiver.exe with all of its commands.

Issue:

echo Installing Citrix Receiver 4.1
c:\temp\CitrixReceiver.exe /silent /includeSSON ENABLE_SSON=yes STORE0="Store;https://xxxx.xxx.com/Citrix/xxxxxx/discovery;on; Citrix Applications" ALLOWADDSTORE=A STARTMENUDIR="CitrixApps" LEGACYFTAICONS=True ADDLOCAL=ReceiverInside,ICA_Client,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d

Script:

@echo off
PUSHD "%~dp0"
 
taskkill /im:ssonsvr.exe /f
taskkill /im:pnamain.exe /f
taskkill /im:wfcrun32.exe /f
taskkill /im:wfica32.exe /f

 
IF EXIST "%ALLUSERSPROFILE%\Citrix\Citrix online plug-inTrolleyExpress.exe" (
echo Uninstalling old Citrix client
"%ALLUSERSPROFILE%\Citrix\Citrix online plug-inTrolleyExpress.exe" /uninstall /cleanup
)

 
IF EXIST "C:\ProgramData\Citrix\Citrix online plug-in – webTrolleyExpress.exe" (
echo Uninstalling old Citrix client
"C:\ProgramData\Citrix\Citrix online plug-in – webTrolleyExpress.exe" /uninstall /cleanupFull
)

 
IF EXIST "C:\ProgramData\CitrixCitrix online plug-inTrolleyExpress.exe" (
echo Uninstalling old Citrix client
"C:\ProgramData\Citrix\Citrix online plug-inTrolleyExpress.exe" /uninstall /cleanup
)

 
IF EXIST "%ALLUSERSPROFILE%\Citrix\Citrix Receiver\TrolleyExpress.exe" (
echo Uninstalling old Citrix client
"%ALLUSERSPROFILE%\Citrix\Citrix Receiver\TrolleyExpress.exe" /uninstall /cleanup
)

IF EXIST "C:\ProgramData\Citrix\Citrix Receiver\TrolleyExpress.exe" (
echo Uninstalling old Citrix client
"C:\ProgramData\Citrix\Citrix Receiver\TrolleyExpress.exe" /uninstall /cleanup
)

::Checking Un-Install ICA_Client on 64-bit OS
 
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /QB
)

 
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{DAA13EB6-C53F-4038-9880-C310500B49E9} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {DAA13EB6-C53F-4038-9880-C310500B49E9} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{956F3E9A-3AED-40F8-8522-5F6A524CFC3E} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {956F3E9A-3AED-40F8-8522-5F6A524CFC3E} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{8F5F8B07-50AC-401F-A441-A37740851A5C} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {8F5F8B07-50AC-401F-A441-A37740851A5C} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{2C42ED1E-6315-4E63-89E6-057EA114EBB8} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {2C42ED1E-6315-4E63-89E6-057EA114EBB8} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{76E4A642-BC3E-438A-8450-0C15A36B5B18l} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {76E4A642-BC3E-438A-8450-0C15A36B5B18l} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{4E21223F-8D6C-446E-9CD3-587D206A8400} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {4E21223F-8D6C-446E-9CD3-587D206A8400} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{DF1D5FEC-D67C-43C8-9230-41F5DF350196} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {DF1D5FEC-D67C-43C8-9230-41F5DF350196} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{D989BCC0-757C-4FB6-893C-512DF4382656} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {D989BCC0-757C-4FB6-893C-512DF4382656} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{7A1FB67F-A340-472A-97C3-A6AFFE078AAE} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {7A1FB67F-A340-472A-97C3-A6AFFE078AAE} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{B2AE44CB-2AAB-4C08-A54B-D264BD604DA8} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {B2AE44CB-2AAB-4C08-A54B-D264BD604DA8} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{E89956F9-5B89-470E-818D-BD46102D0A01} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {E89956F9-5B89-470E-818D-BD46102D0A01} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{42ACCB45-3363-47E0-94E9-F0074CC8BC56} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {42ACCB45-3363-47E0-94E9-F0074CC8BC56} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{2624B680-02BC-4CBC-839C-DA20DF6EF6EC} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {2624B680-02BC-4CBC-839C-DA20DF6EF6EC} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{331741EC-DD63-4DA8-957E-D0C70412EF54} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {331741EC-DD63-4DA8-957E-D0C70412EF54} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall{388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /QB
)

::Checking Un-Install ICA_Client on 32-bit OS
 
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /QB
)

 
reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{DAA13EB6-C53F-4038-9880-C310500B49E9} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {DAA13EB6-C53F-4038-9880-C310500B49E9} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{956F3E9A-3AED-40F8-8522-5F6A524CFC3E} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {956F3E9A-3AED-40F8-8522-5F6A524CFC3E} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{8F5F8B07-50AC-401F-A441-A37740851A5C} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {8F5F8B07-50AC-401F-A441-A37740851A5C} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{2C42ED1E-6315-4E63-89E6-057EA114EBB8} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {2C42ED1E-6315-4E63-89E6-057EA114EBB8} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{76E4A642-BC3E-438A-8450-0C15A36B5B18l} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {76E4A642-BC3E-438A-8450-0C15A36B5B18l} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{4E21223F-8D6C-446E-9CD3-587D206A8400} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {4E21223F-8D6C-446E-9CD3-587D206A8400} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{DF1D5FEC-D67C-43C8-9230-41F5DF350196} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {DF1D5FEC-D67C-43C8-9230-41F5DF350196} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{D989BCC0-757C-4FB6-893C-512DF4382656} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {D989BCC0-757C-4FB6-893C-512DF4382656} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{7A1FB67F-A340-472A-97C3-A6AFFE078AAE} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {7A1FB67F-A340-472A-97C3-A6AFFE078AAE} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{B2AE44CB-2AAB-4C08-A54B-D264BD604DA8} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {B2AE44CB-2AAB-4C08-A54B-D264BD604DA8} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{E89956F9-5B89-470E-818D-BD46102D0A01} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {E89956F9-5B89-470E-818D-BD46102D0A01} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{42ACCB45-3363-47E0-94E9-F0074CC8BC56} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {42ACCB45-3363-47E0-94E9-F0074CC8BC56} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{2624B680-02BC-4CBC-839C-DA20DF6EF6EC} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {2624B680-02BC-4CBC-839C-DA20DF6EF6EC} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{331741EC-DD63-4DA8-957E-D0C70412EF54} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {331741EC-DD63-4DA8-957E-D0C70412EF54} /QB
)

reg query HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /v UninstallString >NUL 2>&1
if %ERRORLEVEL%==0 (
echo Uninstalling old citrix client...
MsiExec.exe /X {388C130B-0079-46B4-A0D5-DC2DD7A89A7B} /QB
)
 
echo Installing Citrix Receiver 4.1
c:\temp\CitrixReceiver.exe /silent /includeSSON ENABLE_SSON=yes STORE0="Store;https://xxxx.xxx.com/Citrix/xxxxxx/discovery;on; Citrix Applications" ALLOWADDSTORE=A STARTMENUDIR="CitrixApps" LEGACYFTAICONS=True ADDLOCAL=ReceiverInside,ICA_Client,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\AuthManager /v ConnectionSecurityMode /t REG_SZ /d Any /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Policies\Citrix /f /v EnableFTU /t REG_DWORD /d 0
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Citrix\Dazzle /f /v UseCategoryAsStartMenuPath /t REG_SZ /d True
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432NODE\Policies\Citrix\ICA Client\SSON" /f /v "Enable" /t REG_SZ /d "true"
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\AuthManager /v ConnectionSecurityMode /t REG_SZ /d Any /f
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Citrix /f /v EnableFTU /t REG_DWORD /d 0
REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\Dazzle /f /v UseCategoryAsStartMenuPath /t REG_SZ /d True
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Citrix\ICA Client\SSON" /f /v "Enable" /t REG_SZ /d "true"
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\xxxxx.xxxx.com"  /f /v "*" /t REG_DWORD /d 1

@IF EXIST reg.exe "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles" (
    ::Deleting Lockdown Profiles on 64-bit OS
    reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Citrix\ICA Client\Engine\Lockdown Profiles" /f >NUL
) ELSE (
    ::Deleting Lockdown Profiles on 32-bit OS
    reg.exe delete "HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles" /f >NUL
)
—————————————————-end script———————————————————————
pause
:end
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
NVITEnd-user support

Commented:
Is c:\temp\CitrixReceiver.exe giving an error?
Does CitrixReceiver.exe have an option/switch to put all the command arguments into a file that it can then call? If so, try that.
Most Valuable Expert 2018
Distinguished Expert 2018

Commented:
Check the user's %Temp% folder for the log files; they'll start with "CtxInstall-" or "TrolleyExpress-".
And for the ADDLOCAL, put double quotes around the options:
ADDLOCAL="ReceiverInside,ICA_Client,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d"
Most Valuable Expert 2018
Distinguished Expert 2018
Commented:
I had a closer look at the script and found some other errors.
- Always use start "" /wait msiexec.exe ... to uninstall from batch, otherwise control will be returned to the script before msiexec really finishes.
- Your reg queries are incorrect, a backslash is missing between "Uninstall" and the GUID.
- The GUID starting with "76E4A642" is incorrect; the last 1 is too much.
- "@IF EXIST reg.exe ..." towards the end doesn't work.
Anyway, here's a shorter version, currently in test mode, it will only echo to the console (see description for the Debug variable).
The caret at the end of a line serves as the line continuation character in batch.
@echo off
setlocal enabledelayedexpansion
PUSHD "%~dp0"

REM set Debug to ECHO to only echo the commands it would normally run; set to empty to run the script for real.
set Debug=echo

REM Processes to kill before uninstalling/installing
set KillProcessList=^
	"ssonsvr.exe" ^
	"pnamain.exe" ^
	"wfcrun32.exe" ^
	"wfica32.exe"

REM Will be uninstalled with /uninstall /cleanup, except for 'Citrix online plug-in – webTrolleyExpress.exe'
set UninstallByFileList=^
	"%ALLUSERSPROFILE%\Citrix\Citrix online plug-inTrolleyExpress.exe" ^
	"C:\ProgramData\Citrix\Citrix online plug-in – webTrolleyExpress.exe" ^
	"C:\ProgramData\CitrixCitrix online plug-inTrolleyExpress.exe" ^
	"%ALLUSERSPROFILE%\Citrix\Citrix Receiver\TrolleyExpress.exe" ^
	"C:\ProgramData\Citrix\Citrix Receiver\TrolleyExpress.exe"

REM Will be uninstalled with msiexec.exe if found in the Uninstall registry key
set UninstallByRegistryList=^
	"{388C130B-0079-46B4-A0D5-DC2DD7A89A7B}" ^
	"{DAA13EB6-C53F-4038-9880-C310500B49E9}" ^
	"{956F3E9A-3AED-40F8-8522-5F6A524CFC3E}" ^
	"{8F5F8B07-50AC-401F-A441-A37740851A5C}" ^
	"{2C42ED1E-6315-4E63-89E6-057EA114EBB8}" ^
	"{76E4A642-BC3E-438A-8450-0C15A36B5B18}" ^
	"{4E21223F-8D6C-446E-9CD3-587D206A8400}" ^
	"{E92B7A19-5FD5-4AEE-9FEF-7AD5DD3A675E}" ^
	"{DF1D5FEC-D67C-43C8-9230-41F5DF350196}" ^
	"{D989BCC0-757C-4FB6-893C-512DF4382656}" ^
	"{7A1FB67F-A340-472A-97C3-A6AFFE078AAE}" ^
	"{B2AE44CB-2AAB-4C08-A54B-D264BD604DA8}" ^
	"{E89956F9-5B89-470E-818D-BD46102D0A01}" ^
	"{42ACCB45-3363-47E0-94E9-F0074CC8BC56}" ^
	"{2624B680-02BC-4CBC-839C-DA20DF6EF6EC}" ^
	"{331741EC-DD63-4DA8-957E-D0C70412EF54}"

if "%PROCESSOR_ARCHITECTURE%"=="AMD64" (set Wow6432Node=\Wow6432Node) else (set Wow6432Node=)
set RegKeySoftware=HKEY_LOCAL_MACHINE\SOFTWARE%Wow6432Node%
set RegKeyUninstall=%RegKeySoftware%\Microsoft\Windows\CurrentVersion\Uninstall

for %%p in (%KillProcessList%) do (
	%Debug% taskkill.exe /im:"%%~p" /f
)
	
for %%f in (%UninstallByFileList%) do (
	if exist "%%~f" (
		if /i "%%~nxf"=="Citrix online plug-in – webTrolleyExpress.exe" (
			set Options=/uninstall /cleanupFull
		) else (
			set Options=/uninstall /cleanup
		)
		echo Uninstalling old client '%%~nxf' ...
		%Debug% "%%~f" !Options!
	)
)

for %%g in (%UninstallByRegistryList%) do (
	reg.exe query "%RegKeyUninstall%\%%~g" /v UninstallString >NUL 2>&1
	if not errorlevel 1 (
		echo Uninstalling old citrix client, GUID %%~g ...
		%Debug% start "" /wait MsiExec.exe /X "%%~g" /QB
	)
)

echo Installing Citrix Receiver 4.1
%Debug% "C:\temp\CitrixReceiver.exe" /silent /includeSSON ENABLE_SSON=yes STORE0="Store;https://xxxx.xxx.com/Citrix/xxxxxx/discovery;on; Citrix Applications" ALLOWADDSTORE=A STARTMENUDIR="CitrixApps" LEGACYFTAICONS=True ADDLOCAL="ReceiverInside,ICA_Client,SSON,AM,SELFSERVICE,USB,DesktopViewer,Flash,Vd3d"

%Debug% reg.exe add "%RegKeySoftware%\Citrix\AuthManager"              /f /v "ConnectionSecurityMode"     /t REG_SZ    /d "Any"
%Debug% reg.exe add "%RegKeySoftware%\Citrix\Dazzle"                   /f /v "UseCategoryAsStartMenuPath" /t REG_SZ    /d "True"
%Debug% reg.exe add "%RegKeySoftware%\Policies\Citrix"                 /f /v "EnableFTU"                  /t REG_DWORD /d 0
%Debug% reg.exe add "%RegKeySoftware%\Policies\Citrix\ICA Client\SSON" /f /v "Enable"                     /t REG_SZ    /d "true"
%Debug% reg.exe add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\xxxxx.xxxx.com"  /f /v "*" /t REG_DWORD /d 1

reg.exe query "%RegKeySoftware%\Citrix\ICA Client\Engine\Lockdown Profiles" >NUL 2>&1
if not errorlevel 1 (
	%Debug% reg.exe delete "%RegKeySoftware%\Citrix\ICA Client\Engine\Lockdown Profiles" /f >NUL 
)

pause
:end

Open in new window

Author

Commented:
Thank you all for all your help, the last rework of the batch script worked perfectly.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial