Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/asp.net-core/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vbscript 为什么WScript.CreateObject(“WScript.Shell”)会崩溃?_Vbscript_Installshield - Fatal编程技术网

Vbscript 为什么WScript.CreateObject(“WScript.Shell”)会崩溃?

Vbscript 为什么WScript.CreateObject(“WScript.Shell”)会崩溃?,vbscript,installshield,Vbscript,Installshield,你认为这条线路会崩溃的原因是什么 设置oShell=WScript.CreateObject(“WScript.Shell”) 。。。仅当我作为自定义操作从InstallShieldXPress启动脚本时 MsgBox "before create ObjectShell" Set oShell = WScript.CreateObject ("WScript.Shell") MsgBox "after create ObjectShell" 我从未看到“创建ObjectShell后”消息-(

你认为这条线路会崩溃的原因是什么 设置oShell=WScript.CreateObject(“WScript.Shell”)

。。。仅当我作为自定义操作从InstallShieldXPress启动脚本时

MsgBox "before create ObjectShell"
Set oShell = WScript.CreateObject ("WScript.Shell")
MsgBox "after create ObjectShell"
我从未看到“创建ObjectShell后”消息-(


如果我只是在windows资源管理器中双击脚本文件来启动脚本,当然一切正常。

可能是全局
WScript
对象在InstallShield环境中不可用。您可以使用如下脚本来检查:

MsgBox Not IsEmpty(WScript) ' True if WScript is defined, False if it's undefined

如果未定义
WScript
,请尝试改用
CreateObject(“WScript.Shell”)
。另请参见更正,InstallShield不支持WScript。