标题: [问题求助] 删除交换机DHCP并重建的VBS怎么自动关闭CMD窗口? [打印本页]
作者: hjhssg 时间: 2017-4-19 23:04 标题: 删除交换机DHCP并重建的VBS怎么自动关闭CMD窗口?
写了一个删除交换机DHCP并重建的脚本VBS。运行完后就停在CMD窗口,因为每天要自动运行很多次,时间长了就会有N多的CMD窗口,请问怎么执行自动关闭,现在的代码如下:- set wshshell=createobject("wscript.shell")
- wshshell.run "cmd"
- wscript.sleep 1000
- wshshell.sendkeys "telnet "
- wscript.sleep 200
- wshshell.sendkeys "192.168.0.1"
- wscript.sleep 200
- wshshell.sendkeys "{ENTER}"
- wscript.sleep 200
- wshshell.sendkeys "11111"
- wscript.sleep 500
- wshshell.sendkeys "{ENTER}"
- wshshell.sendkeys "sys"
- wscript.sleep 300
- wshshell.sendkeys "{ENTER}"
- wshshell.sendkeys "undo dhcp server ip-pool 100"
- wscript.sleep 300
- wshshell.sendkeys "{ENTER}"
- wshshell.sendkeys "dhcp server ip-pool 100"
- wscript.sleep 300
- wshshell.sendkeys "{ENTER}"
- wshshell.sendkeys "network 192.168.100.0 mask 255.255.255.0"
- wscript.sleep 300
- wshshell.sendkeys "{ENTER}"
- wshshell.sendkeys "expired day 0 hour 2"
- wscript.sleep 300
- wshshell.sendkeys "{ENTER}"
复制代码
作者: 9zhmke 时间: 2017-10-8 15:56
加几句退出不就行了?
wshshell.sendkeys "exit"
wscript.sleep 300
wshshell.sendkeys "{ENTER}"
欢迎光临 批处理之家 (http://bbs.bathome.net/) |
Powered by Discuz! 7.2 |