Script to Fix the Delivery Services Console Shortcut

by Jeremy Saunders on November 29, 2009

This script will update any shortcuts to the Delievery Services Console (DSC) and Access Management Console (AMC).

Launching the DSC or AMC on 64-bit system is a bit of a challenge. The CmiLaunch.exe does not work correctly on a 64-bit system. It does not start and we receive the following three errors in the System Event Logs:

Event Source: SideBySide
Event ID: 59
Description: Generate Activation Context failed for C:\WINDOWS\SysWOW64\mmc.exe. Reference error message: The referenced assembly is not installed on your system.

Event Source: SideBySide
Event ID: 59
Description: Resolve Partial Assembly failed for Microsoft.Windows.Common-Controls. Reference error message: The referenced assembly is not installed on your system.

Event Source: SideBySide
Event ID: 32
Description: Dependent Assembly Microsoft.Windows.Common-Controls could not be found and Last Error was The referenced assembly is not installed on your system.

The issue is actually caused by the MS hotfix KB942589 we apply on the 64-bit builds. But this is an important hotfix, so we can’t remove or exclude it. This is further explained by Microsoft in a Technet article titled “Controlling your MMC Snap-ins on 64-bit Operating Systems“. So we need to run the cmi20.msc instead from the “%CommonProgramFiles(x86)%\Citrix\Access Management Console – Framework” folder.

It’s important to note that the cmi20.msc is a 32-bit MMC, and should therefore be launched with the 32-bit MMC by using the following command line:

“%SystemRoot%\system32\mmc.exe” /32 “%CommonProgramFiles(x86)\Citrix\Access Management Console – Framework\cmi20.msc”


‘ This script will update any shortcuts to the Delievery Services Console (DSC) and Access Management Console (AMC).
‘ Launching the DSC or AMC on 64-bit system is a bit of a challenge. The CmiLaunch.exe does not work correctly on a 64-bit
‘ system. It does not start and we receive the following three errors in the System Event Logs:
‘ Event Source: SideBySide
‘ Event ID: 59
‘ Description: Generate Activation Context failed for C:\WINDOWS\SysWOW64\mmc.exe. Reference error message: The referenced
‘ assembly is not installed on your system.
‘ Event Source: SideBySide
‘ Event ID: 59
‘ Description: Resolve Partial Assembly failed for Microsoft.Windows.Common-Controls. Reference error message: The
‘ referenced assembly is not installed on your system.
‘ Event Source: SideBySide
‘ Event ID: 32
‘ Description: Dependent Assembly Microsoft.Windows.Common-Controls could not be found and Last Error was The referenced
‘ assembly is not installed on your system.
‘ The issue is actually caused by the MS hotfix (KB942589) we apply on the 64-bit builds. But this is an important hotfix,
‘ so we can’t remove or exclude it. This is further explained in the following Microsoft Technet article:
‘ http://blogs.technet.com/askperf/archive/2008/04/25/controlling-your-mmc-snap-ins-on-64-bit-operating-systems.aspx
‘ So we need to run the cmi20.msc instead from the “%CommonProgramFiles(x86)%\Citrix\Access Management Console – Framework”
‘ folder.
‘ It’s important to note that the cmi20.msc is a 32-bit MMC, and should therefore be launched with the 32-bit MMC by using
‘ the following command line:
‘ “%SystemRoot%\system32\mmc.exe” /32 “%CommonProgramFiles(x86)\Citrix\Access Management Console – Framework\cmi20.msc”

‘ Release 1.0
‘ Written by Jeremy@jhouseconsulting.com on 22nd November 2009.

Option Explicit

Dim WshShell, strAUPrograms, strProcessorArchitecture, strShortcut

Set WshShell = WScript.CreateObject(“WScript.Shell”)

strAUPrograms = WshShell.SpecialFolders(“AllUsersPrograms”)
strProcessorArchitecture = WshShell.ExpandEnvironmentStrings(“%PROCESSOR_ARCHITECTURE%”)

If lcase(strProcessorArchitecture) <> “x86” Then

strShortcut = strAUPrograms & “\Citrix\Management Consoles\Access Management Console.lnk”
Call CreateShortcut(strShortcut)

strShortcut = strAUPrograms & “\IT Tools\Citrix\Management Consoles\Access Management Console.lnk”
Call CreateShortcut(strShortcut)

strShortcut = strAUPrograms & “\Citrix\Management Consoles\Delivery Services Console.lnk”
Call CreateShortcut(strShortcut)

strShortcut = strAUPrograms & “\IT Tools\Citrix\Management Consoles\Delivery Services Console.lnk”
Call CreateShortcut(strShortcut)

End If

Set WshShell = Nothing

wscript.quit(0)

Sub CreateShortcut(strShortcut)
Dim objFSO, objShortcut, strSystemRoot, strCommonProgramFilesx86
Set objFSO = CreateObject(“Scripting.FileSystemObject”)
strSystemRoot = WshShell.ExpandEnvironmentStrings(“%SystemRoot%”)
strCommonProgramFilesx86 = WshShell.ExpandEnvironmentStrings(“%CommonProgramFiles(x86)%”)
If objFSO.FileExists(strShortcut) Then
objFSO.DeleteFile(strShortcut)
Set objShortcut = WshShell.CreateShortcut(strShortcut)
objShortcut.TargetPath = chr(34) & strSystemRoot & “\system32\mmc.exe” & chr(34)
objShortcut.Arguments = “/32 ” & chr(34) & strCommonProgramFilesx86 & “\Citrix\Access Management Console – Framework\cmi20.msc” & chr(34)
objShortcut.WorkingDirectory= strCommonProgramFilesx86 & “\Citrix\Access Management Console – Framework\”
objShortcut.IconLocation = strCommonProgramFilesx86 & “\Citrix\Access Management Console – Framework\CmiLaunch.exe,0”
objShortcut.Description = “Manage XenApp”
objShortcut.Save
Set objShortcut = Nothing
End If
set objFSO = Nothing
End Sub

Jeremy Saunders

Jeremy Saunders

Technical Architect | DevOps Evangelist | Software Developer | Microsoft, NVIDIA, Citrix and Desktop Virtualisation (VDI) Specialist/Expert | Rapper | Improvisor | Comedian | Property Investor | Kayaking enthusiast at J House Consulting
Jeremy Saunders is the Problem Terminator. He is a highly respected IT Professional with over 35 years’ experience in the industry. Using his exceptional design and problem solving skills with precise methodologies applied at both technical and business levels he is always focused on achieving the best business outcomes. He worked as an independent consultant until September 2017, when he took up a full time role at BHP, one of the largest and most innovative global mining companies. With a diverse skill set, high ethical standards, and attention to detail, coupled with a friendly nature and great sense of humour, Jeremy aligns to industry and vendor best practices, which puts him amongst the leaders of his field. He is intensely passionate about solving technology problems for his organisation, their customers and the tech community, to improve the user experience, reliability and operational support. Views and IP shared on this site belong to Jeremy.
Jeremy Saunders
Jeremy Saunders

Previous post:

Next post: