简体   繁体   English

使用MSScriptControl从UIAccess VB应用程序运行VBScript

[英]Running VBScript from UIAccess VB app using MSScriptControl

I'm trying to run some VBSCRIPT from within my application. 我正在尝试从我的应用程序中运行一些VBSCRIPT。 This works fine when I run my program from within VB. 当我从VB中运行程序时,这可以正常工作。 But once I add "UIAccess=true" to my manifest and digitally sign my exe with my certificate, I am unable to run the code any more. 但是,一旦我在清单中添加“ UIAccess = true”并用证书对exe进行数字签名,我将无法再运行代码。 It gives errors when I try to interface with any program saying "429: ActiveX component can't create object: 'myApp.Application'". 当我尝试与说“ 429:ActiveX组件无法创建对象:'myApp.Application'”的任何程序进行连接时,它给出了错误。 Anyone have any idea why it would run fine in the IDE but not with an application with uses UIAccess? 任何人都知道为什么它可以在IDE中正常运行,但不能与使用UIAccess的应用程序一起运行吗? Here is the code: 这是代码:

Dim scriptRunner As New MSScriptControl.ScriptControlClass

scriptRunner.Language = "VBScript"    
scriptRunner.AllowUI = True    
scriptRunner.Timeout = 3000    
scriptRunner.AddCode(scriptStr)

scriptRunner = Nothing 

In googling around, I found this website . 在谷歌搜索中,我找到了这个网站

it says 它说

Applications with the uiAccess flag set to true must be Authenticode signed to start properly. uiAccess标志设置为true的应用程序必须经过Authenticode签名才能正常启动。 In addition, the application must reside in a protected location in the file system. 此外,应用程序必须位于文件系统中的受保护位置。 \\Program Files\\ and \\windows\\system32\\ are currently the two allowable protected locations. \\ Program Files \\和\\ windows \\ system32 \\当前是两个允许的受保护位置。

maybe it works in your IDE because your IDE is within \\program Files\\, but outside of your IDE you are running the signed application NOT within \\program files or \\windows\\system32 也许它在您的IDE中有效,因为您的IDE在\\ program Files \\中,但是在IDE之外,您正在运行签名的应用程序,而不是在\\ program files或\\ windows \\ system32中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM