dim FSO,WSH
a="H:\a.txt"
set FSO=CreateObject("Scripting.FileSystemObject")
set FSO=CreateObject("Scripting.FileSystemObject")
Set WSH = Wscript.CreateObject("WScript.Shell")
WScript.Sleep 2000 '2秒钟后,执行下面的语句
WSH.run a,1 ‘运行H盘下的文本文件a.txt,其中参数2为显示模式,0为隐藏运行窗口,1为显示运行窗口
set WSH=nothing’释放对象
FSO.deleteFile(Wscript.Scriptname) ‘删除自身
set FSO=nothing '释放对象
如果是定时循环执行某一语句,可以有do.....loop, for.....next 等根据需要选择相应的循环语句即可
温馨提示:答案为网友推荐,仅供参考