TropicalBound Posted July 7, 2011 Posted July 7, 2011 Hello, If I run the command: wmic bios get serialnumber straight from the command prompt, it returns the following: SerialNumber 1234567 However, If I run it in an Autoit script: _RunDOS("wmic bios get serialnumber >> c:\serial.txt"), it returns the following: S e r i a l N u m b e r 1 2 3 4 5 6 7 Any ideas what I'm doing wrong and why the spaces are present? Thanks!! --TB
RichE Posted July 7, 2011 Posted July 7, 2011 (edited) ha har, thats exactly what I'm working on now, and I've nearly finished, here's the code you need to pull back info;output. $objSWbemLocator = ObjCreate("WbemScripting.SWbemLocator") If Not IsObj($objSWbemLocator) Then EndIf $objSWbemServices = $objSWbemLocator.ConnectServer("remotepc", "root\cimv2", "yourdomain" & "\" & "yourusername", "Yourpassword") If Not IsObj($objSWbemServices) Then EndIf $objSWbemServices.Security_.ImpersonationLevel = 3 ;Bios $colItems = $objSWbemServices.ExecQuery("select * from Win32_BIOS") If IsObj($colItems) Then For $objItem In $colItems $Name = $objItem.name $SN = $objItem.SerialNumber Next EndIfI use either a IP range or a workstation list in .csv format for the workstation names.heres what mine looks like so far. Edited July 7, 2011 by RichE RichE [font="'Arial Narrow';"]Current projects[/font] [font="'Arial Narrow';"]are on my site [/font]Sellostring
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