简体   繁体   中英

Running VBScript from UIAccess VB app using MSScriptControl

I'm trying to run some VBSCRIPT from within my application. This works fine when I run my program from within 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. It gives errors when I try to interface with any program saying "429: ActiveX component can't create object: 'myApp.Application'". Anyone have any idea why it would run fine in the IDE but not with an application with uses 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. 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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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