开发者

creating object "wscript.shell" fails

开发者 https://www.devze.com 2022-12-25 04:31 出处:网络
My script looks like: <script type=\"text/vbscript\"> Dim WshShell, oExec Set WshShell = CreateObject(\"WScript.Shell\")

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?


Performing the following resolved the issue foe me.

Start --> Run --> Type "regsvr32.exe wshom.ocx" [without quotes] --> press enter.


problem solved. need to enable few things in internet options - security-custom level- activx

0

精彩评论

暂无评论...
验证码 换一张
取 消