用批处理如何实现telnet登陆并进行一些简单命令
具体如下命令:先登陆到192.168.1.100.telnet192.168.0.100Username:aaaPassword:111登陆之后做几个简单的ping操作p...
具体如下命令:
先登陆到192.168.1.100.
telnet 192.168.0.100
Username:aaa
Password:111
登陆之后做几个简单的ping操作
ping 192.168.0.1
ping 192.168.0.2
请问用cmd的批处理如何实现?
回一楼的,肯定可以的,我要登陆的是台路由,我见有人做过可行的。 展开
先登陆到192.168.1.100.
telnet 192.168.0.100
Username:aaa
Password:111
登陆之后做几个简单的ping操作
ping 192.168.0.1
ping 192.168.0.2
请问用cmd的批处理如何实现?
回一楼的,肯定可以的,我要登陆的是台路由,我见有人做过可行的。 展开
2个回答
展开全部
把如下代码保存为批处理(*.bat)
rem =========Yobo-lily版权=======
@del c:\temp.vbs
@echo on error resume next >>c:\temp.vbs
@echo dim WshShell>>c:\temp.vbs
@echo Set WshShell = WScript.CreateObject("WScript.Shell")>>c:\temp.vbs
@echo WshShell.run"cmd">>c:\temp.vbs
@echo WshShell.AppActivate"c:\windows\system32\cmd.exe">>c:\temp.vbs
@echo WScript.Sleep 200>>c:\temp.vbs
@echo WshShell.SendKeys"telnet 192.168.1.100">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 100>>c:\temp.vbs
@echo WshShell.AppActivate"telnet.exe ">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"aaa">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"111">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"ping 192.168.0.1">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 1000>>c:\temp.vbs
@echo WshShell.SendKeys"ping 192.168.0.2">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 1000>>c:\temp.vbs
@call c:\temp.vbs
rem =========Yobo-lily版权=======
rem =========Yobo-lily版权=======
@del c:\temp.vbs
@echo on error resume next >>c:\temp.vbs
@echo dim WshShell>>c:\temp.vbs
@echo Set WshShell = WScript.CreateObject("WScript.Shell")>>c:\temp.vbs
@echo WshShell.run"cmd">>c:\temp.vbs
@echo WshShell.AppActivate"c:\windows\system32\cmd.exe">>c:\temp.vbs
@echo WScript.Sleep 200>>c:\temp.vbs
@echo WshShell.SendKeys"telnet 192.168.1.100">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 100>>c:\temp.vbs
@echo WshShell.AppActivate"telnet.exe ">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"aaa">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"111">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 2000>>c:\temp.vbs
@echo WshShell.SendKeys"ping 192.168.0.1">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 1000>>c:\temp.vbs
@echo WshShell.SendKeys"ping 192.168.0.2">>c:\temp.vbs
@echo WshShell.SendKeys"{ENTER}">>c:\temp.vbs
@echo WScript.Sleep 1000>>c:\temp.vbs
@call c:\temp.vbs
rem =========Yobo-lily版权=======
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询