DigDeep Posted September 15, 2015 Posted September 15, 2015 Hi,Is there a way, I can display the below command in msgbox?RunWait(@ComSpec & " /c " & "wmic bios get serialnumber", "", @SW_HIDE)
Moderators JLogan3o13 Posted September 15, 2015 Moderators Posted September 15, 2015 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) DigDeep 1 "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!
Gianni Posted September 15, 2015 Posted September 15, 2015 (edited) 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 September 15, 2015 by Chimp Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
DigDeep Posted September 15, 2015 Author Posted September 15, 2015 (edited) Great... thanks to both. I modified as I needed. Edited September 15, 2015 by DigDeep
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