How to Generate a computer's hardware based code to protect the workbook from copying ? :think:
Printable View
How to Generate a computer's hardware based code to protect the workbook from copying ? :think:
Do you mean
[vba]
Environ("ComputerName")
[/vba]
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
Here is a way to get the disk volume id
[vba]
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
[/vba]
which you can get with
diskvolumeid("C")
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
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:
A volume id is an id like a cpu type.
What if they don't have a c:
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
Steve - I don't think you can not have a C:, can you?
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.
Sigh... If you mean so the workbook will only open on one PC for one user, see here (but you're still wasting time - all these things are so easy to get round if you know how :))
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!Quote:
Originally Posted by dansam
That would make him one up on Zack.Quote:
Originally Posted by xld
Zack argues to argue, but not with himself. :rofl: