Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CPU or Harddrive Unique Serial/Hardware Number 3

Status
Not open for further replies.

Zestman

Programmer
Mar 13, 2003
10
ZA
Hi All

I URGENTLY NEED HELP PLEASE

In a VB6 App :

I need a way to get the CPU and or Harddrive unique serial number. But a number that WONT CHANGE if you format the harddrive. Yes, this is for trying to prevent software piracy - only found out that the number changes when you format it just before the BETA1 went out :( A CPU number would be ideal and the app will only work on standalone PC's.

Any help would be MUCH appreciated !
 
Hmmm gets you the serial number but as you said this will change.

Dim fso As Scripting.FileSystemObject
Set fso = New Scripting.FileSystemObject
Dim drv As Scripting.Drive

Set drv = fso.GetDrive("C:\")
MsgBox drv.SerialNumber

Getting the CPU serial number was a privacy issues that was covered with contrivercy. I'd say use the MAC address if the machine wasn't stand alone. You could use a profile. Grab a bunch of information about the machine and generate your serial key based on that. You just have to tell them if they reconfigure the machine that they'll have to request a new key.

What happens if they have a computer go bad? You going to force them to buy a new copy or show proof that the machine went bad? How do you provide proof that a particular CPU has gone bad.

Normal programs that need this type of security use hardware dongles. Then the you fix all the problems above.
 
I agree with SemperFiDownUnda. But many apps don't fall in a price range that requires the use of a dongle.

I like his idea of generating a serial key based on a range of machine information. Make a key based on, let's say, the HD serial and the MAC address and the Windows product key and the motherboard serial (if available). That way, if the HD is upgraded or the NIC is replaced or Windows is upgraded or the motherboard is changed, the program can alter its own key to reflect the new information and continue.

Real men don't use Interrupt 21h.
 
Hmmm good idea

I found this code, but has no idea if it will work on a normal Windows 95 system aswell... Anyone wanna test this for me ?? :))



Private Sub Command1_Click()


'========================
Dim WMI
Dim wmiWin32Objects
Dim wmiWin32Object
Dim ComputerName As String

ComputerName = "." ' must be your computers name for it to work
Set WMI = GetObject("WinMgmts://" & ComputerName)

Set wmiWin32Objects = WMI.InstancesOf("Win32_Processor")
With wmiWin32Object
For Each wmiWin32Object In wmiWin32Objects
List1.AddItem "AddressWidth: " & .AddressWidth
List1.AddItem "Architecture: " & .Architecture
List1.AddItem "Availability: " & .Availability
List1.AddItem "Caption: " & .Caption
List1.AddItem "ConfigManagerErrorCode: " & .ConfigManagerErrorCode
List1.AddItem "ConfigManagerUserConfig: " & .ConfigManagerUserConfig
List1.AddItem "CpuStatus: " & .CpuStatus
List1.AddItem "CreationClassName: " & .CreationClassName
List1.AddItem "CurrentClockSpeed: " & .CurrentClockSpeed
List1.AddItem "CurrentVoltage: " & .CurrentVoltage
List1.AddItem "DataWidth: " & .DataWidth
List1.AddItem "Description: " & .Description
List1.AddItem "DeviceID: " & .DeviceID
List1.AddItem "ErrorCleared: " & .ErrorCleared
List1.AddItem "ErrorDescription: " & .ErrorDescription
List1.AddItem "ExtClock: " & .ExtClock
List1.AddItem "Family: " & .Family
List1.AddItem "InstallDate: " & .InstallDate
List1.AddItem "L2CacheSize: " & .L2CacheSize
List1.AddItem "L2CacheSpeed: " & .L2CacheSpeed
List1.AddItem "LastErrorCode: " & .LastErrorCode
List1.AddItem "Level: " & .Level
List1.AddItem "LoadPercentage: " & .LoadPercentage
List1.AddItem "Manufacturer: " & .Manufacturer
List1.AddItem "MaxClockSpeed: " & .maxclockspeed
List1.AddItem "Name: " & .Name
List1.AddItem "OtherFamilyDescription: " & .OtherFamilyDescription
List1.AddItem "PNPDeviceID: " & .PNPDeviceID
List1.AddItem "PowerManagementCapabilities: " & .PowerManagementCapabilities
List1.AddItem "PowerManagementSupported: " & .PowerManagementSupported
List1.AddItem "ProcessorId: " & .ProcessorId
List1.AddItem "ProcessorType: " & .ProcessorType
List1.AddItem "Revision: " & .Revision
List1.AddItem "Role: " & .Role
List1.AddItem "SocketDesignation: " & .SocketDesignation
List1.AddItem "Status: " & .Status
List1.AddItem "StatusInfo: " & .StatusInfo
List1.AddItem "Stepping: " & .Stepping
List1.AddItem "SystemCreationClassName: " & .SystemCreationClassName
List1.AddItem "SystemName: " & .SystemName
List1.AddItem "UniqueId: " & .UniqueId
List1.AddItem "UpgradeMethod: " & .UpgradeMethod
List1.AddItem "Version: " & .Version
List1.AddItem "VoltageCaps: " & .VoltageCaps
List1.AddItem "Description: " & .Description
List1.AddItem "Manufacturer: " & .Manufacturer
List1.AddItem "MaxClockSpeed: " & .maxclockspeed
Next

End With


End Sub
 
Zestman>
I'm also trying to include the hardware information into my app. The solution that I found is getting the HDD serial number which can be change everytime the user format his/her computer. So, I'm trying to find out other hardware information.

1. Is the code reading the CPU ID directly from the hardware or from the OS?

2. Will the value of the listed field above will be vary everytime the user format his/her computer?

3. Is the code workable in Window 95?

Helps would be appreciate.

From
lykeat
 
lykeat

See strongm's answer in thread222-782251

You should also read FAQ222-2244, especially paragraphs 8, 13, 14, 15 and 16 to find how to get the best from this forum as previously advised.


________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
johnwm>

Just for your notice, I did read the faq u listed above for many many times, and I also did some keyword search before posting any messages. By the way, the thread you mentioned is created by me. I really appreciate advice from you. :)

I do have a suggestion for your consideration too. Everyone in this site is asking for helps or providing helps to the others. It would be annoying if the same question was repeated for many times. If you noticed this bad phenomena, you may advice them to read the FAQ222-2244 (That's what you always practice) and provide them some solution.

I also did tried on some of the code and first thing that I discovered is HDD serial number which is vary everytime the user format the pc or will be the same if the user duplicate/clone/ghost the entire harddisk. I also know that there is no unique computer id, I understand that very clear.

What I am trying to find out is,
1. The cpu id captured by using this code is varying everytime the user format his/her computer?
 
The CPU ID IF AVAILABLE will remain with the CPU regardless of HDD formatting. Many CPUs do not have a UID. You can also normally turn off CPUID in BIOS

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
I always have my CPU ID turned off. I believe most BIOSes ship with it disabled, as well.

Also, the CPU ID may be an Intel-only thing. With 43% of gamers using AMD processors, that's a big market segment that won't have IDs.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top