{"id":433,"date":"2009-11-29T01:04:45","date_gmt":"2009-11-28T17:04:45","guid":{"rendered":"http:\/\/www.jhouseconsulting.com\/?p=433"},"modified":"2009-11-29T09:55:09","modified_gmt":"2009-11-29T01:55:09","slug":"script-to-fix-the-delivery-services-console-shortcut","status":"publish","type":"post","link":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2009\/11\/29\/script-to-fix-the-delivery-services-console-shortcut-433","title":{"rendered":"Script to Fix the Delivery Services Console Shortcut"},"content":{"rendered":"<p>This script will update any shortcuts to the Delievery Services Console (DSC) and Access Management Console (AMC).<\/p>\n<p>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:<\/p>\n<p style=\"padding-left: 30px;\">Event Source: SideBySide<br \/>\nEvent ID: 59<br \/>\nDescription: Generate Activation Context failed for C:\\WINDOWS\\SysWOW64\\mmc.exe. Reference error message: The referenced assembly is not installed on your system.<\/p>\n<p style=\"padding-left: 30px;\">Event Source: SideBySide<br \/>\nEvent ID: 59<br \/>\nDescription: Resolve Partial Assembly failed for Microsoft.Windows.Common-Controls. Reference error message: The referenced assembly is not installed on your system.<\/p>\n<p style=\"padding-left: 30px;\">Event Source: SideBySide<br \/>\nEvent ID: 32<br \/>\nDescription: Dependent Assembly Microsoft.Windows.Common-Controls could not be found and Last Error was The referenced assembly is not installed on your system.<!--more--><\/p>\n<p>The issue is actually caused by the MS hotfix <a href=\"http:\/\/support.microsoft.com\/kb\/942589\" target=\"_blank\">KB942589<\/a> we apply on the 64-bit builds. But this is an important hotfix, so we can&#8217;t remove or exclude it. This is further explained by Microsoft in a Technet article titled &#8220;<a href=\"http:\/\/blogs.technet.com\/askperf\/archive\/2008\/04\/25\/controlling-your-mmc-snap-ins-on-64-bit-operating-systems.aspx\" target=\"_blank\">Controlling your MMC Snap-ins on 64-bit Operating Systems<\/a>&#8220;. So we need to run the cmi20.msc instead from the &#8220;%CommonProgramFiles(x86)%\\Citrix\\Access Management Console \u2013 Framework&#8221; folder.<\/p>\n<p>It&#8217;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:<\/p>\n<p style=\"padding-left: 30px;\">&#8220;%SystemRoot%\\system32\\mmc.exe&#8221; \/32 &#8220;%CommonProgramFiles(x86)\\Citrix\\Access Management Console &#8211; Framework\\cmi20.msc&#8221;<\/p>\n<p><dirtycode:FixDSCShortcut.vbs><br \/>\n&#8216; This script will update any shortcuts to the Delievery Services Console (DSC) and Access Management Console (AMC).<br \/>\n&#8216; 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<br \/>\n&#8216; system. It does not start and we receive the following three errors in the System Event Logs:<br \/>\n&#8216;   Event Source: SideBySide<br \/>\n&#8216;   Event ID: 59<br \/>\n&#8216;   Description: Generate Activation Context failed for C:\\WINDOWS\\SysWOW64\\mmc.exe. Reference error message: The referenced<br \/>\n&#8216;                assembly is not installed on your system.<br \/>\n&#8216;   Event Source: SideBySide<br \/>\n&#8216;   Event ID: 59<br \/>\n&#8216;   Description: Resolve Partial Assembly failed for Microsoft.Windows.Common-Controls. Reference error message: The<br \/>\n&#8216;                referenced assembly is not installed on your system.<br \/>\n&#8216;   Event Source: SideBySide<br \/>\n&#8216;   Event ID: 32<br \/>\n&#8216;   Description: Dependent Assembly Microsoft.Windows.Common-Controls could not be found and Last Error was The referenced<br \/>\n&#8216;                assembly is not installed on your system.<br \/>\n&#8216; The issue is actually caused by the MS hotfix (KB942589) we apply on the 64-bit builds. But this is an important hotfix,<br \/>\n&#8216; so we can&#8217;t remove or exclude it. This is further explained in the following Microsoft Technet article:<br \/>\n&#8216; http:\/\/blogs.technet.com\/askperf\/archive\/2008\/04\/25\/controlling-your-mmc-snap-ins-on-64-bit-operating-systems.aspx<br \/>\n&#8216; So we need to run the cmi20.msc instead from the &#8220;%CommonProgramFiles(x86)%\\Citrix\\Access Management Console \u2013 Framework&#8221;<br \/>\n&#8216; folder.<br \/>\n&#8216; It&#8217;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<br \/>\n&#8216; the following command line:<br \/>\n&#8216; &#8220;%SystemRoot%\\system32\\mmc.exe&#8221; \/32 &#8220;%CommonProgramFiles(x86)\\Citrix\\Access Management Console &#8211; Framework\\cmi20.msc&#8221;<br \/>\n&#8216;<br \/>\n&#8216; Release 1.0<br \/>\n&#8216; Written by Jeremy@jhouseconsulting.com on 22nd November 2009.<br \/>\n&#8216;<br \/>\nOption Explicit<\/dirtycode:fixdscshortcut.vbs><\/p>\n<p>Dim WshShell, strAUPrograms, strProcessorArchitecture, strShortcut<\/p>\n<p>Set WshShell = WScript.CreateObject(&#8220;WScript.Shell&#8221;)<\/p>\n<p>strAUPrograms = WshShell.SpecialFolders(&#8220;AllUsersPrograms&#8221;)<br \/>\nstrProcessorArchitecture = WshShell.ExpandEnvironmentStrings(&#8220;%PROCESSOR_ARCHITECTURE%&#8221;)<\/p>\n<p>If lcase(strProcessorArchitecture) <> &#8220;x86&#8221; Then<\/p>\n<p>  strShortcut = strAUPrograms &#038; &#8220;\\Citrix\\Management Consoles\\Access Management Console.lnk&#8221;<br \/>\n  Call CreateShortcut(strShortcut)<\/p>\n<p>  strShortcut = strAUPrograms &#038; &#8220;\\IT Tools\\Citrix\\Management Consoles\\Access Management Console.lnk&#8221;<br \/>\n  Call CreateShortcut(strShortcut)<\/p>\n<p>  strShortcut = strAUPrograms &#038; &#8220;\\Citrix\\Management Consoles\\Delivery Services Console.lnk&#8221;<br \/>\n  Call CreateShortcut(strShortcut)<\/p>\n<p>  strShortcut = strAUPrograms &#038; &#8220;\\IT Tools\\Citrix\\Management Consoles\\Delivery Services Console.lnk&#8221;<br \/>\n  Call CreateShortcut(strShortcut)<\/p>\n<p>End If<\/p>\n<p>Set WshShell = Nothing<\/p>\n<p>wscript.quit(0)<\/p>\n<p>Sub CreateShortcut(strShortcut)<br \/>\n  Dim objFSO, objShortcut, strSystemRoot, strCommonProgramFilesx86<br \/>\n  Set objFSO = CreateObject(&#8220;Scripting.FileSystemObject&#8221;)<br \/>\n  strSystemRoot = WshShell.ExpandEnvironmentStrings(&#8220;%SystemRoot%&#8221;)<br \/>\n  strCommonProgramFilesx86 = WshShell.ExpandEnvironmentStrings(&#8220;%CommonProgramFiles(x86)%&#8221;)<br \/>\n  If objFSO.FileExists(strShortcut) Then<br \/>\n    objFSO.DeleteFile(strShortcut)<br \/>\n    Set objShortcut = WshShell.CreateShortcut(strShortcut)<br \/>\n    objShortcut.TargetPath = chr(34) &#038; strSystemRoot &#038; &#8220;\\system32\\mmc.exe&#8221; &#038; chr(34)<br \/>\n    objShortcut.Arguments = &#8220;\/32 &#8221; &#038; chr(34) &#038; strCommonProgramFilesx86 &#038; &#8220;\\Citrix\\Access Management Console &#8211; Framework\\cmi20.msc&#8221; &#038; chr(34)<br \/>\n    objShortcut.WorkingDirectory= strCommonProgramFilesx86 &#038; &#8220;\\Citrix\\Access Management Console &#8211; Framework\\&#8221;<br \/>\n    objShortcut.IconLocation = strCommonProgramFilesx86 &#038; &#8220;\\Citrix\\Access Management Console &#8211; Framework\\CmiLaunch.exe,0&#8221;<br \/>\n    objShortcut.Description = &#8220;Manage XenApp&#8221;<br \/>\n    objShortcut.Save<br \/>\n    Set objShortcut = Nothing<br \/>\n  End If<br \/>\n  set objFSO = Nothing<br \/>\nEnd Sub<br \/>\n<\/dirtycode><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8230; <a title=\"Script to Fix the Delivery Services Console Shortcut\" class=\"read-more\" href=\"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/2009\/11\/29\/script-to-fix-the-delivery-services-console-shortcut-433\" aria-label=\"Read more about Script to Fix the Delivery Services Console Shortcut\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[5],"tags":[163,164,162,161,160,159,111,165],"class_list":["post-433","post","type-post","status-publish","format-standard","hentry","category-scripting","tag-64-bit","tag-64bit","tag-access-management-console","tag-amc","tag-delivery-services-console","tag-dsc","tag-shortcut","tag-x64"],"aioseo_notices":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/comments?post=433"}],"version-history":[{"count":4,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/433\/revisions"}],"predecessor-version":[{"id":460,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/posts\/433\/revisions\/460"}],"wp:attachment":[{"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/media?parent=433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/categories?post=433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jhouseconsulting.com\/jhouseconsulting\/wp-json\/wp\/v2\/tags?post=433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}