Jump to content

WMIC Bios


Recommended Posts

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

Link to comment
Share on other sites

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
                        EndIf

I use either a IP range or a workstation list in .csv format for the workstation names.

heres what mine looks like so far.

Posted Image

Edited by RichE

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...