Jump to content

"Piping" from cmd.exe


Recommended Posts

Well, I've seen you all talk about "piping" info from cmd.exe and I know you use the | char. I've also used the > char for this. But here's the thing. Say I start a telnet session using cmd.exe. When I attempt to use >blah.txt to export the info to a text file to be parsed, it only comes up with an empty txt file. This doesn't happen with normal commands. But it does with telnet. Can anyone provide me with a small example of how I can pull this info out of the window to parse it? Thank you.

Link to comment
Share on other sites

  • Developers

Should I take that as a no?

<{POST_SNAPBACK}>

The file will be empty till the Telnet program is closed.

Or are you saying that its always empty?

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

The file will be empty till the Telnet program is closed. 

Or are you saying that its always empty?

<{POST_SNAPBACK}>

JdeB, I may be way off here, but is there anything like StdOut (I think it stands for Standard Output in VB), that allows AutoIt to read command line output? I did look in the Help File, but I couldn't find anything related to this.

Just thinking out loud,

Ian

"Blessed be the name of the Lord" - Job 1:21Check out Search IMF

Link to comment
Share on other sites

  • Developers

JdeB, I may be way off here, but is there anything like StdOut (I think it stands for Standard Output in VB), that allows AutoIt to read command line output?  I did look in the Help File, but I couldn't find anything related to this.

Just thinking out loud,

Ian

<{POST_SNAPBACK}>

Not yet... i know its on the TODO list and have seen some posts on it by others working on something already...

But to my knowledge, Telnet will dump its output to a file when you use > and is readable after TELNET is closed.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Not yet... i know its on the TODO list and have seen some posts on it by others working on something already...

But to my knowledge, Telnet will dump its output to a file when you use > and is readable after TELNET is closed.

<{POST_SNAPBACK}>

I'm thinking that's all fine and good as long as the telnet session is relatively short....a long session could end up overflowing the memory buffers? Correct me if I'm wrong, but I would think that would be the case as it would be storing all the output in a buffer until the program exited.

12/30/2004 13:08:08.46
C:\>telnet /?

telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
 -a   Attempt automatic logon. Same as -l option except uses
         the currently logged on user's name.
 -e   Escape character to enter telnet client prompt.
 -f   File name for client side logging
 -l   Specifies the user name to log in with on the remote system.
         Requires that the remote system support the TELNET ENVIRON option.
 -t   Specifies terminal type.
         Supported term types are vt100, vt52, ansi and vtnt only.
 host   Specifies the hostname or IP address of the remote computer
         to connect to.
 port   Specifies a port number or service name.

Why not use a telnet.exe -f C:\directory\log.txt host:port command? That should parse the text as it comes though the buffer instead of waiting for the close of the program.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Link to comment
Share on other sites

Hmm, ok thanks I will try this. Thanks for the input guys. I'm not familiar with the commands available really, but i wanted to telnet into my pop3 server and do something with it. And a couple other things that this info would be relevant for. Again thanks for the tips. Also, I didn't want to use the terminal client for this. Purpose is mainly to learn to pipe info from cmd.exe so I'll know how to utilize it.

I'm thinking that's all fine and good as long as the telnet session is relatively short....a long session could end up overflowing the memory buffers?  Correct me if I'm wrong, but I would think that would be the case as it would be storing all the output in a buffer until the program exited.

12/30/2004 13:08:08.46
C:\>telnet /?

telnet [-a][-e escape char][-f log file][-l user][-t term][host [port]]
 -a   Attempt automatic logon. Same as -l option except uses
         the currently logged on user's name.
 -e   Escape character to enter telnet client prompt.
 -f   File name for client side logging
 -l   Specifies the user name to log in with on the remote system.
         Requires that the remote system support the TELNET ENVIRON option.
 -t   Specifies terminal type.
         Supported term types are vt100, vt52, ansi and vtnt only.
 host   Specifies the hostname or IP address of the remote computer
         to connect to.
 port   Specifies a port number or service name.

Why not use a telnet.exe -f C:\directory\log.txt host:port command?  That should parse the text as it comes though the buffer instead of waiting for the close of the program.

<{POST_SNAPBACK}>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...