创建对象“wscript.shell”失败
我的脚本如下所示:
<script type="text/vbscript">
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("cmd /c cd D:\d & D: & winzip32.exe -min -a D:\a")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.Status
</script>
这个想法是使用资源管理器打开这些文件。我遇到的问题是在线:
Set WshShell = CreateObject("WScript.Shell")
我不断收到消息
ActiveX 组件无法创建对象:“WScript.Shell”
我完全感到困惑,因为如果我将其写入,这个完全相同的代码可以正常运行 一个 .htm
文件。
为什么我的浏览器对 .asp
页面的处理方式与 .html
文件不同?
我该如何解决这个问题?
My script looks like:
<script type="text/vbscript">
Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
Set oExec = WshShell.Exec("cmd /c cd D:\d & D: & winzip32.exe -min -a D:\a")
Do While oExec.Status = 0
WScript.Sleep 100
Loop
WScript.Echo oExec.Status
</script>
The idea was to use explorer to open these files. The problem I'm having though is on the line:
Set WshShell = CreateObject("WScript.Shell")
I keep getting the message
ActiveX component can't create object: 'WScript.Shell'
I'm totally confused because this exact same code runs fine if I write it in
a .htm
file.
Why does my browser treat my .asp
page differently than the .html
file?
How do I fix this problem?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
执行以下操作解决了我的问题。
开始-->运行-->输入“regsvr32.exe wshom.ocx”[不带引号] -->按回车键。
Performing the following resolved the issue foe me.
Start --> Run --> Type "regsvr32.exe wshom.ocx" [without quotes] --> press enter.
问题解决了。需要在互联网选项中启用一些东西 - 安全 - 自定义级别 - activx
problem solved. need to enable few things in internet options - security-custom level- activx