Advertisement
lordhenthai

Get pc serial code thru name

Sep 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. On Error Resume Next
  2. Dim strComputer
  3. strComputer = InputBox("Enter the name of the computer:")
  4. Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
  5. Set colSMBIOS = objWMIService.ExecQuery ("Select * from Win32_SystemEnclosure")
  6. For Each objSMBIOS in colSMBIOS
  7. Dim tmp
  8. tmp = InputBox(strComputer,,objSMBIOS.SerialNumber)
  9. next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement