![Vbs Get Monitor Serial Number Vbs Get Monitor Serial Number](/uploads/1/2/5/7/125711278/963742619.gif)
VBS - How to get HD serial number
The results is exactly what our Management expects,. Jul 21, 2015 Retrieve Monitor Serial Number Using PowerShell Small script to retrieve monitor serial number using PowerShell, using a WMI method called WmiMonitorID under the rootwmi namespace. This WMI method exist from Vista and above, if you are having XP and below, you still can retrieve the information using a registry query and convert the EDID to the monitor information which include the.
VBS - How to get HD serial number
Hi there,
Here is my vbs code to read HD serial number. The WMI return only a unintelligible byte value. So I've written a conversion function.
----------------------------------------
strComputer = '.'
Set objWMIService = GetObject('winmgmts:{impersonationLevel=impersonate}!' & strComputer & 'rootcimv2')
str = '
Set colItems = objWMIService.ExecQuery('SELECT * FROM Win32_PhysicalMedia')
For Each objItem In colItems
str = objItem.SerialNumber & vbCrlf & vbCrlf
msgbox( 'Serial Number : ' & ConvertSN(Str))
next
Function ConvertSN(Str)
DIM Hxstr
DIM i
Hxstr = '
for i=0 to (Len(str)/4)-2
Hxstr = Hxstr & chr('&H' & mid(str,4*i+3,2)) & chr('&H' & mid(str,4*i+1,2))
next
Hxstr = trim(Hxstr)
ConvertSN = Hxstr
end function
------------------------------------------
Here is my vbs code to read HD serial number. The WMI return only a unintelligible byte value. So I've written a conversion function.
----------------------------------------
strComputer = '.'
Set objWMIService = GetObject('winmgmts:{impersonationLevel=impersonate}!' & strComputer & 'rootcimv2')
str = '
Set colItems = objWMIService.ExecQuery('SELECT * FROM Win32_PhysicalMedia')
For Each objItem In colItems
str = objItem.SerialNumber & vbCrlf & vbCrlf
msgbox( 'Serial Number : ' & ConvertSN(Str))
next
Function ConvertSN(Str)
DIM Hxstr
DIM i
Hxstr = '
for i=0 to (Len(str)/4)-2
Hxstr = Hxstr & chr('&H' & mid(str,4*i+3,2)) & chr('&H' & mid(str,4*i+1,2))
next
Hxstr = trim(Hxstr)
ConvertSN = Hxstr
end function
------------------------------------------