Jump to content

_RunSTD


w0uter
 Share

Recommended Posts

for all the people that have trouble using STD

Func _RunSTD($s_p, $s_wd = @WorkingDir, $s_f = @SW_HIDE)
    Local $s_r = '', $i_pid = Run($s_p, $s_wd, $s_f, 2)
    While Not @error
        $s_r &= StdoutRead($i_pid)
    WEnd
    Return $s_r
EndFunc

ConsoleWrite(StringReplace(_RunSTD(@ComSpec & ' /c ipconfig /all'), @CR, '') & @LF)

My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll

Link to comment
Share on other sites

  • 2 weeks later...

if i wanted to see the "output" of say a telnet session or ftp session could i use this?

lets say i need to authenticate to a firewall via telnet

so i write a script to run telnet and then enter my login and pw.

if i wanted to watch this process but not interact, could it be done?

Link to comment
Share on other sites

if i wanted to see the "output" of say a telnet session or ftp session could i use this?

lets say i need to authenticate to a firewall via telnet

so i write a script to run telnet and then enter my login and pw.

if i wanted to watch this process but not interact, could it be done?

Kind-of, yes. There are examples on this forum that do the latter part of what you describe, by AutoIt capturing the output of a console process and displaying it, in a GUI edit box for example, as in the example linked above.

The problem with doing specifically what you've asked is that Windows telnet won't run if the standard input is redirected (or XP's won't at least) which prevents AutoIt from entering "interactive" commands on your behalf.

I've used Console Telnet as a replacement for the Windows version, and I know that other forum users have used Plink because it will do both telnet and SSH.

for all the people that have trouble using STD

Thanks for this UDF, @w0uter, and I should have said so before now.

If you can come up with a UDF for _StdxxxReadLine I'd be interested to see how you'd make it work.

Edited by DaveF

Yes yes yes, there it was. Youth must go, ah yes. But youth is only being in a way like it might be an animal. No, it is not just being an animal so much as being like one of these malenky toys you viddy being sold in the streets, like little chellovecks made out of tin and with a spring inside and then a winding handle on the outside and you wind it up grrr grrr grrr and off it itties, like walking, O my brothers. But it itties in a straight line and bangs straight into things bang bang and it cannot help what it is doing. Being young is like being like one of these malenky machines.

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...