Archive

Posts Tagged ‘Wmic’

How to find computer serial number

2010/11/16 Leave a comment

source: http://support.microsoft.com/kb/558124

Instructions

Please use one the method bellow to retrieve the computer serial number:1. Using the buid in “wmic” command:

wmic bios get serialnumber

Tip: You can use the command “wmic csproduct get name” to retrieve the local computer model.

2. Using a vbs script:

On Error Resume Next
 Dim strComputer
 strComputer = InputBox("Enter the name of the computer:")
 Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
 Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
 For Each objSMBIOS in colSMBIOS
 MsgBox strComputer & ": " & objSMBIOS.SerialNumber
 Next
Categories: Shell, VBS/BATCH Tags: , ,