Sign in to follow this  
Followers 0
avery

[solved] Capture output from external system call?

5 posts in this topic

#1 ·  Posted (edited)

I am trying to execute something like:

C:\WINDOWS\system32>net localgroup administrators
Alias name   administrators
Comment     Administrators have complete and unrestricted access to the computer/domain

Members

-------------------------------------------------------------------------------
Administrator
avery
The command completed successfully.


C:\WINDOWS\system32>

Grab the output and display it in my GUI control.

I did some searches on the forums here and found a way to pipe my RunWait into a text file and just read that back into the au3 app but that takes up a temp file. Is there a better way to do this that anyone is willing to share with me/us?

Please and thanks for reading.

-avery

Edited by avery

www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org

Share this post


Link to post
Share on other sites



#include <Process.au3>

MsgBox(0,"",DOS_Output("net localgroup administrators"))

Func DOS_Output($COMMAND)
_RunDOS( $COMMAND  & ">" & @TempDir & "\DOS_Output.dat")
$FILE = FileOpen(@TempDir & "\DOS_Output.dat",0)
$OUT = FileRead($FILE)
FileClose($FILE)
Return $OUT
EndFunc


When the words fail... music speaks

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I did some searches on the forums here and found a way to pipe my RunWait into a text file and just read that back into the au3 app but that takes up a temp file. Is there a better way to do this that anyone is willing to share with me/us?

Use the StdOutRead() Function.

Jos

Edited by Jos

Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

I will give it a shot as soon as I get rid of my GF lol.

thank you very much. always a pleasure to hear from a developer.

-avery


www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

I will give it a shot as soon as I get rid of my GF lol.

thank you very much. always a pleasure to hear from a developer.

-avery

Worked really good Jos. Thank you.

Edited by avery

www.abox.orgAvery HowellVisit My AutoIt Websitehttp://www.abox.org

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  
Followers 0