Rogue5099 Posted January 28, 2010 Share Posted January 28, 2010 (edited) cmd line I want to run is: "wmic bios get serialnumber" I want to be able to get this info to a variable. I tried the following: $console = Run(@ComSpec & " /c wmic bios get serialnumber", '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) MsgBox(0, "???", StdoutRead($console)) I at least am able to see the serial number in the following but can't do nothing with it and it is too window contolling, trying to aviod Send()... Run("cmd.exe") Sleep(1000) Send("wmic bios get serialnumber{ENTER}") Edited January 28, 2010 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Rogue5099 Posted January 28, 2010 Author Share Posted January 28, 2010 Ok i got this far: Local $console = Run(@ComSpec & " /c wmic bios get serialnumber", @ScriptDir, @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD) Local $iError, $line, $Result = "" While 1 $line = StdOutRead($console) $iError = @error If $iError Then ExitLoop $Result = $line Sleep(10) Wend MsgBox(0, "???", $Result) Now just need to isolate s/n.... My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
Rogue5099 Posted January 28, 2010 Author Share Posted January 28, 2010 (edited) Fixed!!!! Problem Solved, just had to work through it bymyself... If anyone knows a better way please post! Local $console = Run(@ComSpec & " /c wmic bios get serialnumber", @ScriptDir, @SW_HIDE, $STDOUT_CHILD) Local $line, $Result = "" While 1 Sleep(100) $line = StdOutRead($console) If @error Then ExitLoop $Result = $line Wend $Result = StringTrimLeft($Result, 17) MsgBox(0, "???", $Result) Edited January 28, 2010 by rogue5099 My projects: Inventory / Mp3 Inventory, Computer Stats Link to comment Share on other sites More sharing options...
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