Jump to content
DigDeep

Display Commandline results

Recommended Posts

JLogan3o13

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)

 

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Chimp

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
DigDeep

Great... thanks to both. I modified as I needed. :thumbsup:

Edited by DigDeep

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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.