Board logo

标题: 请vbs高手分析这段代码错在哪里?? [打印本页]

作者: stornager     时间: 2007-5-2 15:29    标题: 请vbs高手分析这段代码错在哪里??

Dim fso,WshShell
Set fso=CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile "C:\test.txt"


set WshShell=Wscript.CreateObject("WScript.WshShell")
Do
fso.CopyFile "C:\test.txt","D:\test.txt"
WScript.Sleep 6000
Loop
这段程序运行时会显示无法找到名为"WScript.WshShell"的”automation"的类
为什么会这样???
作者: baomaboy     时间: 2007-5-2 15:33

Dim fso,WshShell
Set fso=CreateObject("Scripting.FileSystemObject")
fso.CreateTextFile "C:\test.txt"

Set WshSHell=WScript.CreateObject("WScript.Shell")
'set WshShell=Wscript.CreateObject("WScript.WshShell")
Do
fso.CopyFile "C:\test.txt","D:\test.txt"
WScript.Sleep 6000
Loop

作者: slore     时间: 2007-5-2 15:33
CreateObject("Wscript.Shell")
作者: stornager     时间: 2007-5-2 15:43
我太马虎了,谢谢高手指教!!