编写一个bat文件。可以实现telnet自动输入帐号和密码
天天要登陆路由器。需要在windows+R---cmd---telnet192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击...
天天要登陆路由器。需要在windows+R---cmd---telnet 192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击就行了。不用再输入帐号和密码了,哪们兄弟帮忙写一下,谢谢。
还是不行呀。我就是想写个bat。不用输入帐号admin和密码admin123456的。 展开
还是不行呀。我就是想写个bat。不用输入帐号admin和密码admin123456的。 展开
2个回答
展开全部
把如下代码保存为批处理(*.bat)
rem ================
@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.1">>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
@call c:\temp.vbs
rem ================
rem ================
@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.1">>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
@call c:\temp.vbs
rem ================
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询