Extract MachinID

Questions related to the distribution, marketing and selling of applications created with NeoBook. (Formally titled: "Making Money with NeoBook")

Moderator: Neosoft Support

Neosoft Support
NeoSoft Team
Posts: 5628
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA
Contact:

Post by Neosoft Support »

The code I posted is for the entire function file. Copy it into Notepad and save it into your NeoBook Functions folder.

If pasting directly into NeoBook's function editor, use just this part:

Code: Select all

strComputer = "." 
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") 

Set colBIOS = objWMIService.ExecQuery("Select * from Win32_BIOS") 

For each objBIOS in colBIOS 
  publication.nbSetVar "[BIOSSerialNum]", objBIOS.SerialNumber 
Next
NeoSoft Support
Thunder
Posts: 22
Joined: Sat Apr 11, 2009 2:21 pm

Post by Thunder »

Hi

Somebody would have some example in .pub

Thanks

Thunder
rishi
Posts: 71
Joined: Wed Oct 05, 2005 1:23 pm

Post by rishi »

Hi all:

In my computer, in the variable [BIOSSerialNum], appears the expression "System Serial Number" as a result.

Somebody would be able to help me.

Thanks.

Gustavo
Tony Kroos
Posts: 419
Joined: Thu Oct 15, 2009 3:43 pm

Post by Tony Kroos »

It is just impossible to get BIOS serial number on some systems. Also, it is impossible to get a motherboard s/n from some devices (s/n may be just printed out on board surface, and that's all :))) The same situation with HDD serial (real hardware s/n, not volume id). If you want to implement a reliable hw-check, use Processor identification:

Code: Select all

On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor")
For Each objItem in colItems
    NbSetVar "[CPU_Clock]", objItem.CurrentClockSpeed
    NbSetVar "[CPU_Name]", objItem.Name
    NbSetVar "[CPU_ID]", objItem.ProcessorId
Next
Copy this to Neobook function editor as VBScript, save and call. Processor ID will be returned to [CPU_ID] variable. Btw, you may want to detect processor name and clock speed for other needs, here you are - look into [CPU_Name] and [CPU_Clock] variables.
Locked