Jump to content
Sign in to follow this  
DigDeep

Display Commandline results

Recommended Posts

Like this, maybe?

#include <Constants.au3>

$net = Run(@ComSpec & " /c wmic bios get serialnumber", "", @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
$final = ""

While 1
    $line = StdoutRead($net)
    If @error Then ExitLoop
    If $line <> "" Then $final &= $line
Wend

    MsgBox(0, "STDOUT read:", $final)

 


"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Share this post


Link to post
Share on other sites

just for fun, here is also a shrinked version

#include <Constants.au3>

Local $net = Run("wmic bios get serialnumber", "", "", $STDERR_MERGED), $final = ""

Do
    $final &= StdoutRead($net) ; stores the output of the wmic command while is generated
Until @error ; when wmic finish, it closes itself, so StdoutRead arises an @error

MsgBox(0, "STDOUT read:", $final)

 

Edited by Chimp

small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...