wscript.createobject("wscript.shell").run "cmd"
dim a
a=inputbox("","PIng IP")
wsh.setkeys"ping"
wscript.sleep 200
wsh.setkeys"{space}"&a
wscript.sleep 20
wsh.sendkeys "~"
为什么输入IP后提示错误。
而且有没有办法是哪个dos窗口不要弹出来
wscript.createobject("wscript.shell").run "cmd"
dim a
a=inputbox("","PIng IP")
wsh.setkeys"ping"
wscript.sleep 200
wsh.setkeys"{space}"&a
wscript.sleep 20
wsh.sendkeys "~"
为什么输入IP后提示错误。
而且有没有办法是哪个dos窗口不要弹出来
dim wsh
Set wsh = wscript.CreateObject("wscript.shell")
dim a
a=inputbox("","PIng IP")
wsh.run "cmd.exe /k ping " & a
如不需要出现命令行窗口最后一句改为
wsh.run "cmd.exe /k ping " & a,0 '这样是隐藏
wsh.run "cmd.exe /k ping " & a,6 '这样是最小化
dim wsh Set wsh = wscript.CreateObject("wscript.shell") wsh.run "cmd.exe /c" wsh.visibled=false dim a a=inputbox("","PIng IP")
wsh.sendkeys "ping" wscript.sleep 200 wsh.sendkeys " " & a wscript.sleep 20 wsh.sendkeys "~"