Chance1 Posted June 29, 2017 Share Posted June 29, 2017 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 More sharing options...
Developers Jos Posted June 29, 2017 Developers Share Posted June 29, 2017 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 More sharing options...
Chance1 Posted June 29, 2017 Author Share Posted June 29, 2017 (edited) When I tried it, it runs the command line and there is no telnet.exe running. I'll keep testing just to be sure. Edited June 29, 2017 by Chance1 Link to comment Share on other sites More sharing options...
Developers Jos Posted June 29, 2017 Developers Share Posted June 29, 2017 Try changing the /c to /k and remove the @sw_hide for testing. 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 More sharing options...
Chance1 Posted June 29, 2017 Author Share Posted June 29, 2017 (edited) 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 June 29, 2017 by Chance1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now