2013-07-11 3 views
5

라우터에 텔넷으로 연결하고 싶습니다. 하루에 여러 번 로그인 할 필요가 없도록 자동화하고 싶습니다.SendKeys없이 텔넷 세션을 자동화하는 방법

VBS의 sendkeys와 별도의 다른 방법이 있습니까? 이것은 물리적으로 유형이 있기 때문에 텔넷 창이 활성화되어야하기 때문에 다소 짜증이납니다.

배치 파일을 시도했지만 실제로 이상한 결과가 나타납니다. 여기있다 : 여기

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와 다른 방법을 사용할 수 있습니까?

+0

당신은'핑 255.255.255.255 -n 1 -w 1000> nul'이 george'는 텔넷 클라이언트로 전송해야한다'cmd.exe를에 의해 실행되지만 기대 ? cmd.exe가 예상 한 내용을 어떻게 알아야합니까? – jeb

+0

오 - 연결에 약간의 시간이 걸리므로 ping을 사용하여 지연을 만들었습니다. 그래서 무한 루프가 생기는 것입니까? – George

답변

5
당신은이 도구에 대한 구글 수

: 그것은 스크립트 창 TELNET.EXE하지 않지만 그것은 스크립트 텔넷이다 고객. 알버트 예일에 의해

Telnet Scripting Tool v.1.0

+1

감사합니다. openDNS에서 제공 한 링크에 오류가있어 [여기] (http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php)를 발견했습니다. – George

관련 문제