How to Generate a computer's hardware based code to protect the workbook from copying ?![]()
How to Generate a computer's hardware based code to protect the workbook from copying ?![]()
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.![]()
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
A volume id is an id like a cpu type.
What if they don't have a c:
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
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
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
Steve - I don't think you can not have a C:, can you?
Enjoy,
Tony
---------------------------------------------------------------
Give a man a fish and he'll eat for a day.
Teach him how to fish and he'll sit in a boat and drink beer all day.
I'm (slowly) building my own site: www.WordArticles.com
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.
Steve
"Nearly all men can stand adversity, but if you want to test a man's character, give him power."
-Abraham Lincoln
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)
You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you![]()
The major part of getting the right answer lies in asking the right question...
Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.
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!Originally Posted by dansam
That would make him one up on Zack.Originally Posted by xld
Zack argues to argue, but not with himself.![]()
Brandtrock