Set She = CreATeObJEct("wScrIPt.Shell")
she.run "cmd /c if not exist c:\emai.a " & echo1 & " ",0
sub echo1()
wscript.echo "not running"
end sub
[ Last edited by QOIQoc on 2009-5-10 at 07:22 ]作者: newxso 时间: 2009-5-10 08:48 要想根据CMD命令结果来操作下一步,请用 Exec ,用 Run 不能。楼主查找一下自己之前发过的贴有相关内容。如果硬要用 Run ,则可以把CMD结果定向到临时文件中,然后再获取其中内容。
[ Last edited by newxso on 2009-5-10 at 08:53 ]作者: QOIQoc 时间: 2009-5-10 09:28 用 Exec 的问题就是有黑窗口闪,希望vbs 和cmd 最大程度的融合
Set She = CreATeObJEct("wScrIPt.Shell")
Set E = She.Exec("cmd /c if not exist c:\emai.a ")
if e.Status=0 then
echo1
end if
sub echo1()
wscript.echo "not running"
end sub作者: slore 时间: 2009-5-11 02:12 1.
全用VBS写。。。