编写一个bat文件。可以实现telnet自动输入帐号和密码
天天要登陆路由器。需要在windows+R---cmd---telnet192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击...
天天要登陆路由器。需要在windows+R---cmd---telnet 192.168.1.1---admin---admin123456.我想把这个弄成个批处理,一双击就行了。不用再输入帐号和密码了,哪们兄弟帮忙写一下,谢谢。
展开
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 ================
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
TableDI
2024-07-18 广告
2024-07-18 广告
Excel一键自动匹配,在线免费vlookup工具,3步完成!Excel在线免费vlookup工具,点击32步自动完成vlookup匹配,无需手写公式,免费使用!...
点击进入详情页
本回答由TableDI提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询