Jump to content

Recommended Posts


If I run the command: wmic bios get serialnumber straight from the command prompt, it returns the following:



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?



Link to post
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

                        $objSWbemLocator = ObjCreate("WbemScripting.SWbemLocator")
                        If Not IsObj($objSWbemLocator) Then

                        $objSWbemServices = $objSWbemLocator.ConnectServer("remotepc", "root\cimv2", "yourdomain" & "\" & "yourusername", "Yourpassword")
                        If Not IsObj($objSWbemServices) Then

                        $objSWbemServices.Security_.ImpersonationLevel = 3
                        $colItems = $objSWbemServices.ExecQuery("select * from Win32_BIOS")
                        If IsObj($colItems) Then
                            For $objItem In $colItems
                                $Name = $objItem.name
                                $SN = $objItem.SerialNumber

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


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

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

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...