wordpress   发布时间:2022-04-02  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了Windows – 如何在没有SendKeys的情况下自动执行Telnet会话大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

概述

我想telnet到我的路由器,我想自动化它,所以我不必一直登录,因为我一天做几次. 除了VBS中的sendkeys之外还有其他方法吗?这是因为物理类型,所以telnet窗口需要是活动的,而且相当烦人. 我尝试了一个批处理文件,但结果却非常奇怪.这里是: telnet 192.168.1.254 REM This is the router IP ping 255.255.255.255 -n 1
我想telnet到我的路由器,我想自动化它,所以我不必一直登录,因为我一天做几次.

除了VBS中的sendkeys之外还有其他方法吗?这是因为物理类型,所以telnet窗口需要是活动的,而且相当烦人.

我尝试了一个批处理文件,但结果却非常奇怪.这里是:

telnet 192.168.1.254
REM This is the router IP
ping 255.255.255.255 -n 1 -w 1000 > nul
REM This is to wait for the router if its being slow
George 
REM This is the username,as it prompts as soon as it logs in
ping 255.255.255.255 -n 1 -w 1000 > nul
(the password)
ping 255.255.255.255 -n 1 -w 1000 > nul
system
REM Enters the system menu
ping 255.255.255.255 -n 1 -w 10 > nul
debug
REM Enters the Debug menu
ping 255.255.255.255 -n 1 -w 100 > nul
:s
 cpu
 REM This lets me see the cpu usage
 ping 255.255.255.255 -n 1 -w 1000 > nul
 REM Wait while it lists it
 mem
 REM Checks the memory 
 ping 255.255.255.255 -n 1 -w 1000 > nul
 REM Waits again!
goto s
REM I need a loop otherwise I would have to type out lots of code!

结果如下:

C:\Users\George\Desktop>telnet 192.168.1.254

C:\Users\George\Desktop>telnet 192.168.1.254
^C Terminate batch job (Y/N)?

它为什么这样做?这将是我的预期结果……

Username : George
Password : *******
------------------------------------------------------------------------

                             ______  Technicolor TG582n
                         ___/_____/\
                        /         /\\  8.C.M.0.AR
                  _____/__       /  \\
                _/       /\_____/___ \  Copyright (c) 1999-2012,Technicolor
               //       /  \       /\ \
       _______//_______/    \     / _\/______
      /      / \       \    /    / /        /\
   __/      /   \       \  /    / /        / _\__
  / /      /     \_______\/    / /        / /   /\
 /_/______/___________________/ /________/ /___/  \
 \ \      \    ___________    \ \        \ \   \  /
  \_\      \  /          /\    \ \        \ \___\/
     \      \/          /  \    \ \        \  /
      \_____/          /    \    \ \________\/
           /__________/      \    \  /
           \   _____  \      /_____\/
            \ /    /\  \    /___\/
             /____/  \  \  /
             \    \  /___\/
              \____\/

------------------------------------------------------------------------
{George}=>system
{George}=>debug
{George}[system debug]=>cpu
cpu (%):    Idle     User     Kernel
           57.43     0.99    41.58
{George}[system debug]=>mem
Total:                    61280 KB
Used:                     45216 KB
  by kernel:              30748 KB
  by applications:        14468 KB
{George}[system debug]=>

那么,为什么这样做呢?

除了sendkeys之外,我可以使用其他方法吗?

解决方法

您可以谷歌搜索此工具:它不会编写Windows telnet.exe脚本,但它是一个可编写脚本的telnet客户端.

Telnet Scripting Tool v.1.0作者:Albert Yale

大佬总结

以上是大佬教程为你收集整理的Windows – 如何在没有SendKeys的情况下自动执行Telnet会话全部内容,希望文章能够帮你解决Windows – 如何在没有SendKeys的情况下自动执行Telnet会话所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: