Jump to content

Process wont run with opt_flags


Recommended Posts

Hey guys, I am trying to run a process and use the stdin, stdout, stderr streams, but when I attach the opt_flags in the run;

$TNPid = Run('C:\Windows\System32\telnet.exe', '', @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD)

The process opens and closes right away, not allowing for the commands to be sent to it. But If I have the run command like this:

$TNPid = Run('C:\Windows\System32\telnet.exe', '', @SW_HIDE)

It works fine, but I have to use ControlSend commands to write, and I am unable to get the stdout and error for the process.

 

Any ideas as to why this is happening? Thanks.

Link to comment
Share on other sites

  • Developers

What about?:

$TNPid = Run(@comspec & ' /c telnet.exe', '', @SW_HIDE, $STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD)

Jos

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

So, I have been messing with it. When I do this: 

$TNPid = Run(@comspec & ' /k telnet.exe' , '', '', $STDIN_CHILD + $STDOUT_CHILD + $STDERR_CHILD)

I am still getting that the command prompt window is running, even with the following commands to try and get telnet to run:

StdinWrite($TNPid, "C:" & @LF)
    StdinWrite($TNPid, "cd Windows\System32" & @LF)
    StdinWrite($TNPid, "telnet.exe" & @LF)

However, When I run this:

$TNPid = Run(@comspec & ' /k telnet.exe') ;or a /c

telnet.exe opens up right away. When it comes up, it have a title of "C:\Windows\System32\cmd.exe - telnet"

Edited by Chance1
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...