批处理命令问题
setlog=C:/aa.txtcall:scriptfilestarttelnet/f%log%192.168.1.100cscript//nologotelnet_t...
set log=C:/aa.txt
call :scriptfile
start telnet /f %log% 192.168.1.100
cscript //nologo telnet_tmp.vbs
exit
:scriptfile
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo sh.SendKeys "admin{ENTER}" >>telnet_tmp.vbs
echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "conf{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "int ethernet 1/1{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "shutdown{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "end{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "q{ENTER}">>telnet_tmp.vbs
goto :eof
end
这个批处理命令执行完成后就不退出dos窗口了,使进程一直在运行,怎么才能关闭呢?我是用JAVA调用的批处理命令,Java代码如下:
String command = "cmd /c"+"start /min out.bat";
try {
Process ps = Runtime.getRuntime().exec(command);
} catch (IOException ex) {
Logger.getLogger(TelBat.class.getName()).log(Level.SEVERE, null, ex);
} 展开
call :scriptfile
start telnet /f %log% 192.168.1.100
cscript //nologo telnet_tmp.vbs
exit
:scriptfile
echo set sh=WScript.CreateObject("WScript.Shell") >telnet_tmp.vbs
echo sh.SendKeys "admin{ENTER}" >>telnet_tmp.vbs
echo sh.SendKeys "admin{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "conf{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "int ethernet 1/1{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "shutdown{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "end{ENTER}">>telnet_tmp.vbs
echo sh.SendKeys "q{ENTER}">>telnet_tmp.vbs
goto :eof
end
这个批处理命令执行完成后就不退出dos窗口了,使进程一直在运行,怎么才能关闭呢?我是用JAVA调用的批处理命令,Java代码如下:
String command = "cmd /c"+"start /min out.bat";
try {
Process ps = Runtime.getRuntime().exec(command);
} catch (IOException ex) {
Logger.getLogger(TelBat.class.getName()).log(Level.SEVERE, null, ex);
} 展开
2个回答
万山数据
2024-11-04 广告
2024-11-04 广告
实时数仓处理是我们北京万山数据科技有限公司数据处理能力的核心之一。它基于先进的流处理技术,能够实时捕获、处理和分析海量数据,确保数据的时效性和准确性。通过构建高效的实时数据管道,我们能够实现数据的即时入库与查询,为业务决策提供强有力的支持。...
点击进入详情页
本回答由万山数据提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询