PDA

View Full Version : Solved: Generate a computer's hardware code



dansam
02-17-2007, 06:11 AM
How to Generate a computer's hardware based code to protect the workbook from copying ? :think:

Bob Phillips
02-17-2007, 07:02 AM
Do you mean



Environ("ComputerName")

dansam
02-17-2007, 08:29 AM
Hi,
Thanks for your example, but I don?t want to get a computer?s name because it can easily changed, I want to generate a code based on the computer?s hardware or its CPU. (If you know , when we right click on My Computer Icon and select Properties option and then a window appears , you can find a code in it in the General Tab under the caption ?Registered To : xyz <code goes here> . I think that you know this. So, I want to use that code as my code and I want to insert it in A1 cell. ) Or any other idea, if anyone have?


I have an attached a picture of software which uses that code. So, how to get it?
Hope that you can understand the matter ?




Link : http://www.excelshield.com/en/excelshield/tour3.htm

Bob Phillips
02-17-2007, 10:01 AM
Here is a way to get the disk volume id



Function DiskVolumeId(Drive As String) As String
Dim sTemp As String
Dim iPos As Long
iPos = InStr(1, Drive, ":")
Drive = IIf(iPos > 0, Left(Drive, iPos), Drive & ":")
sTemp = Hex(CreateObject("Scripting.FileSystemObject") _
.Drives.Item(CStr(Drive)).SerialNumber)
DiskVolumeId = Left(sTemp, 4) & "-" & Right(sTemp, 4)
End Function


which you can get with

diskvolumeid("C")

dansam
02-17-2007, 10:42 AM
hi xld,
thanks ,......but any idea for any other code or id like any type of cpu code or any other ????

Thanks for your example ,
regards,
dan

lucas
02-17-2007, 11:15 AM
Hi Dan,
Still chasing your tail trying to make excel secure? You need to go to visual basic and create your app. Excel will never be secure the way you seem to want it to be.:hi:

Bob Phillips
02-17-2007, 01:06 PM
A volume id is an id like a cpu type.

lucas
02-17-2007, 01:09 PM
What if they don't have a c:

TonyJollans
02-17-2007, 01:11 PM
I think you are wasting your time (and are more likely to alienate paying customers than anything else) but the product ID you mention is in the registry at HKLM\Software\Microsoft\Windows\CurrentVersion\ProductId

TonyJollans
02-17-2007, 01:12 PM
Steve - I don't think you can not have a C:, can you?

lucas
02-17-2007, 01:51 PM
You wouldn't think so would you but yes you can not have a c.... I don't have one. I have a 300 gig exteral that when I turn it on becomes my C: but system is on F: and it works fine.

johnske
02-18-2007, 02:11 AM
Sigh... If you mean so the workbook will only open on one PC for one user, see here (http://xlvba.3.forumer.com/index.php?showtopic=274) (but you're still wasting time - all these things are so easy to get round if you know how :))

dansam
02-18-2007, 02:44 AM
Hi ,
The problem is around the "C" then why not use this :
diskvolumeid(Environ("SystemDrive"))

where Environ("SystemDrive") returns C; or d or the disk where the windows is loacted ...

Bob Phillips
02-18-2007, 03:33 AM
Hi ,
The problem is around the "C" then why not use this :
diskvolumeid(Environ("SystemDrive"))

where Environ("SystemDrive") returns C; or d or the disk where the windows is loacted ...

You're arguing against yourself now!

Brandtrock
02-19-2007, 01:08 AM
You're arguing against yourself now!

That would make him one up on Zack.

Zack argues to argue, but not with himself. :rofl: