写了一个删除交换机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}"
复制代码
|