编写一个bat文件。可以实现telnet自动输入帐号和密码
天天要登陆路由器。需要在windows+R---cmd---telnet192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击...
天天要登陆路由器。需要在windows+R---cmd---telnet 192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击就行了。不用再输入帐号和密码了,哪们兄弟帮忙写一下,谢谢。
展开
1个回答
2013-08-04
展开全部
把如下代码保存为批处理(*.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 ================
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询