VBS:ActiveX 组件无法创建对象:64 位上的“Citrix.ICAClient"错误 [英] VBS: ActiveX component can't create object: 'Citrix.ICAClient' errror on 64-bit

查看:58
本文介绍了VBS:ActiveX 组件无法创建对象:64 位上的“Citrix.ICAClient"错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个脚本,用于查找所有打开的 Citrix 连接并断开与登录到 Windows 的用户无关的任何连接(Citrix Web Interface 连接).它在 32 位机器(XP 或 7)上运行良好,但在 64 位机器上运行不正常.我知道它确实依赖于两个 Citrix reg 密钥(AllowLiveMonitoring & AllowSimulationAPI)和 WfIcaLib.dll,它们将位于不同的位置不同的架构.我认为这是我的脚本和 64 位的问题,但是当我从 32 位机器上卸载接收器时,我得到了完全相同的错误.当我重新安装时,错误消失了.没有特殊的安装开关或方法,只需定期安装 3.4.300 接收器.因此,尽管它必须与 64 位相关,但它与 Citrix 相关,而不仅仅是 VBScript 代码.

I have a script that looks for all open Citrix connections and disconnects any of them that aren't associated with the user logged in to Windows (Citrix Web Interface connections). It works perfectly fine on 32-bit machines (XP or 7) but not on 64-bit. I know it does rely on two Citrix reg keys (AllowLiveMonitoring & AllowSimulationAPI) and the WfIcaLib.dll, which will be in different locations on different architecture. I thought it was something with my script and 64-bit, but when I uninstall the Receiver from a 32-bit machine, I get the same exact error. And when I reinstall, the error goes away. No special install switches or method, just a regular install of the 3.4.300 Receiver. So although it must be 64-bit related, it's with Citrix and not just the VBScript code.

这是我的脚本,Set icaClient = CreateObject("Citrix.ICAClient") 行是出错的地方.

Here is my script, the Set icaClient = CreateObject("Citrix.ICAClient") line is where it errors.

提前致谢.布莱恩

Option Explicit
Dim strWindowsUser
Dim icaClient
Dim sessionHandle
Dim numSessions
Dim sessionID
Dim sessionInfo
Dim ct
Dim wshNetwork

' Get the name of the generic Windows user logged in

Set wshNetwork = WScript.CreateObject("WScript.Network")
strWindowsUser = wshNetwork.UserName

' As the next user is logging into the workstation, look for any
' Citrix sessions not tied to the generic Windows user and disconnect
' the session. 
' If you don't want to disconnect, use a Logoff command as follows:
' icaClient.Logoff()

Set icaClient = CreateObject("Citrix.ICAClient")
sessionHandle = icaClient.EnumerateCCMSessions()
numSessions = icaClient.GetEnumNameCount(sessionHandle)x

For ct = 0 To numSessions - 1

sessionID = icaClient.GetEnumNameByIndex(sessionHandle, ct)
icaClient.StartMonitoringCCMSession sessionID, True

'SessionServer = 0,
'SessionUsername = 1
'SessionDomain = 2
sessionInfo = icaClient.GetSessionString(1)
If lcase(sessionInfo) <> lcase(strWindowsUser) Then
    icaClient.Disconnect()
End If

icaClient.StopMonitoringCCMSession sessionID 

Next

icaClient.CloseEnumHandle sessionHandle

推荐答案

尝试手动指定 64 位 cscript.exe

Try manually specifying the 64bit cscript.exe

C:>%windir%syswow64cscript.exe script.vbs

C:>%windir%syswow64cscript.exe script.vbs

我没有机器可以尝试这个,但这是过去对我有用的方法.

I don't have a machine to try this on, but this is what's worked for me in the past.

测试了您的代码,它在硬编码 64 位 cscript 时有效.我使用的是 Windows 8.1 (x64) 和 Receiver 4.2 (ICA Client 14.2)

Tested your code and it works when hardcoding the 64bit cscript. I'm using Windows 8.1 (x64) and Receiver 4.2 (ICA Client 14.2)

c:	ools>cscript.exe text.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

c:	ools	ext.vbs(22, 1) Microsoft VBScript runtime error: ActiveX component can't create object: 'Citrix.ICAClient'

c:	ools>%windir%syswow64cscript.exe text.vbs
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

c:	ools>

这篇关于VBS:ActiveX 组件无法创建对象:64 位上的“Citrix.ICAClient"错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆