russell Posted November 23, 2010 Share Posted November 23, 2010 How do i see the output of this to test? i tried MSG box but it said $serialnumber was undeclaired That's what we use in our company Func getpcserialnumber() ; Generated by AutoIt Scriptomatic $wbemFlagReturnImmediately = 0x10 $wbemFlagForwardOnly = 0x20 $colItems = "" $strComputer = "localhost" $Output="" $Output = $Output & "Computer: " & $strComputer & @CRLF $Output = $Output & "==========================================" & @CRLF $objWMIService = ObjGet("winmgmts:\\" & $strComputer & "\root\CIMV2") if $objWMIService=0 then ;lognio("ERROR: WMI corrupted on workstation, cannot get the information.") return -1 endif $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_BIOS", "WQL", _ $wbemFlagReturnImmediately + $wbemFlagForwardOnly) If IsObj($colItems) then For $objItem In $colItems $serialnumber = $objItem.SerialNumber Next Else $serialnumber=-1 Endif return $serialnumber endfunc muppet hands are so soft :) 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