批处理 telenet问题

来源:百度知道 编辑:UC知道 时间:2024/06/09 14:43:55
最近在工作中用到一些批处理文件(已经写好),全部是批处理文件,文件内容如下:rem 启动telnet
start telnet xxx.xxx.xxx.xxx
rem batch telnet
cscript //nologo yantan.vbs
还有一个vbs文件,用于统计远程设备的在线用户数,公司要求在每天21:00左右运行,总共6个设备(也就有6个批处理文件),我在电脑上设置了计划任务,但是发现,每次运行新的任务后,旧的窗口就被关闭了,我的要求是旧的窗口不关闭,因为我要统计在线人数。不过有什么方法(不能同时运行,而且只能在当前窗口运行),只要能够在运行新的批处理文件时,旧得不关闭就行。

set objwsh=createobject("wscript.shell")
b=objwsh.run("cmd.exe /k start telnet xxx.xxx.xxx.xxx")
c=objwsh.run("cmd.exe /k cscript //nologo yantan.vbs")

把六个批处理写成一个文件不就是了,最后在PAUSE暂停一下。