tags:

views:

64

answers:

0

Hello,

I am trying to execute cmds on a remote CPU through telnet. While some commands sent (through Ruby's stdlib for telnet) are successful, others are giving me a weird response:

*===============================================================
Welcome to Microsoft Telnet Server.
*===============================================================
C:\Documents and Settings\UserJW>ls
Desktop
Favorites
My Documents
Start Menu
Sti_Trace.log

C:\Documents and Settings\UserJW>cd\
More?

Why is telnet giving me this "More?" response, as if expecting something?

In the code, I am simply connecting to remote CPU, logging in, and sending commands:

@connection = Net::Telnet.new(...)  
@connection.login( user, pwd )  
@connection.cmd(...)  

Any help would be appreciated.

Thanks, J

**EDIT:

@connection = Net::Telnet.new(
"Host" => machine,
"Prompt" => /[A-Za-z]:\\.*>\z/n,
"Timeout" => 3,
"Output_log" => output )
@connection.login( user, pwd )
@connection.cmd( 'ls' )
@connection.cmd( 'ls' )

output...

C:\Documents and Settings\UserJW>
ls
Desktop
Favorites
My Documents
Start Menu
Sti_Trace.log
C:\Documents and Settings\UserJW>
ls
More?

I can't even send more than one command, apparently. Is my Prompt regex wrong? I'm trying to allow..

C:[anything...]>