Jump to content
Sign in to follow this  

command prompt interaction ... help!

Recommended Posts


OK... I can't seem to interface with command prompt.

I have numerous devices that I can interface via telnet through the command prompt.

They also have web interfaces but that takes much more time to communicate with.

I've searched through these forums and I thought I could use something like the StdinWrite / StdoutRead but that doesn't seem to work too well.

Or maybe I am using them wrong.

Heres the code I've been trying to get to work:

#include <Constants.au3>

$foo = Run("cmd.exe", "", @SW_MAXIMIZE, $STDIN_CHILD + $STDOUT_CHILD)

StdinWrite($foo, "telnet" & @CRLF)
StdinWrite($foo, "password" & @CRLF)


MsgBox(0, "Debug", StdoutRead($foo))

I'm trying to send the line: telnet

and then wait for the password prompt and send: password

Then wait a little bit longer and just read what's on the command prompt.

Any suggestions would be greatly appreciated. Thanks!

Share this post

Link to post
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
Sign in to follow this