2013-07-11 9 views
5

Yönlendiricime telnet yapmak istiyorum ve bunu otomatikleştirmek istiyorum, böylece günde birkaç kez yaptığım gibi her zaman giriş yapmak zorunda kalmam.SendKeys Olmadan Telnet Oturumu Nasıl Otomatikleştirilir

VBS'de sendkeyler dışında başka bir yöntem var mı? Bunun nedeni, fiziksel olarak türler, bu yüzden telnet penceresinin aktif olması gerekiyor, oldukça rahatsız edici.

Bir toplu iş dosyasını denedim, ancak gerçekten garip sonuçlar alıyorum. İşte burada: Burada

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! 

sonuçlar şöyle:

C:\Users\George\Desktop>telnet 192.168.1.254 

C:\Users\George\Desktop>telnet 192.168.1.254 
^C Terminate batch job (Y/N)? 
Neden bunu yapıyor

? Bu benim beklenen sonucum olabilirdi ...

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]=> 

Peki, neden bunu yapıyor?

Sendkeyler dışında başka bir yöntem kullanabilir miyim?

+0

Bir 'ping 255.255.255.255 -n 1 -w 1000> nul' george' telnet istemcisi gönderilmesi gerekmektedir' cmd.exe tarafından yürütülen, ancak bekliyoruz ? Cmd.exe ne beklediğinizi bilmeli? – jeb

+0

Oh - Bağlantı kurmak için biraz zaman aldığından, bir gecikme oluşturmak için ping kullanıyordum. Bu yüzden sonsuz bir döngü elde ettim mi? – George

cevap

5
Bu araç için google

: Bu komut pencereleri telnet.exe gelmez ama bir script telnet olduğunu istemcisi. Albert Yale tarafından

Telnet Scripting Tool v.1.0

+1

Teşekkürler - openDNS verdiğiniz bağlantı ile bir hata döndürdüğü için [burada] (http://support.moonpoint.com/downloads/windows/network/Telnet/tst10.php) – George

İlgili konular