Link to home
Start Free TrialLog in
Avatar of Luis Alonso Ramos
Luis Alonso RamosFlag for Mexico

asked on

Unique machine ID

How can I get an ID that is the same for one machine across reboots, but it is different for each machine?

It must exist on both Windows 9x and NT/2000.
Avatar of Ruchi
Ruchi

http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?lngWId=1&txtCodeId=6249

"The code shows you User ID, Hostname, IP adress, and Port number of the local machine."
Avatar of Luis Alonso Ramos

ASKER

Sometimes the computer will not have access to the internet or even a network adapter installed. I don't think the IP address would do it.
The hostname is a character string, easily obtained by Ruchi's suggested method (or several others).  But users can change the CPU name.
A couple of years ago, Intel got in very hot Public Relations waters for wanting to put serial numbers in the CPUs for this very purpose.  The privacy implications are unacceptable to most people, so the computer hardware is (mostly) anonymous and what you're asking for doesn't exist.  The Internet industry has somewhat gotten around this by the use of cookies.  Cookies, in essence, are unique files that you would store on each machine, and you would put unique data in the file, or in the filename, so you could retrieve it later.  Within a corporate setting, this is probably just as acceptable as uniquely ID'ing the hardware.
It does not have a hardware ID... some kind of data that is generated at Windows setup and will remain the same after each boot. The idea is for a program to know it is being run on the machine on which it was installed, and not copied to another one.
Oops... In my previous comment "It does not have a hardware ID" should have been "It does not have to be a hardware ID"
Take the value of the Timer method and save it in the registry
ASKER CERTIFIED SOLUTION
Avatar of arcusd
arcusd

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
arcusd, I guess that should work, I'll give it a try.
I think that will work... but does it work for UNC paths? how?
Information about UNC paths:
http://www.avdf.com/june98/art_vb006.html
I think this is what you are looking for.

http://www.vb2themax.com/Item.asp?PageID=CodeBank&ID=89
Convert from a file path to a UNC path.

http://www.vb2themax.com/Item.asp?PageID=CodeBank&ID=64
My question is if arcusd's routine will work for UNC paths?? If I run my program through the network, how do I know it is valid if I compare the stored volume ID to that of the machine it is running on?
Thanks for the tip, you got me on the right track. I still had to modify it a little bit to work for my situation.