Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 28 APR 2008 03:58:22PM Ana Melisa Heras wrote:

I´d like to know if there is a practical way that we can ensure that a Run time is going to work only in a specific computer.

Is there a OI function that can retrieve the hard disk serial number or the Windows XP,Vista,Server 2000 or Server 2003 ID (The one that you can see into the PC Properties)?

Thanks for your suggestions…


At 28 APR 2008 05:49PM Richard Hunt wrote:

You could use the MAC address of the network card of the computer as an unique id. Kinda along the same lines as the Disk id. Check this thread out…

http://www.revelation.com/Discuss.nsf/f12696d31000b22a8525652b00831bb2/8F8041E2FFBBBF4585257168006F0CB0?OpenDocument


At 28 APR 2008 06:18PM Jim Vaughan wrote:

At 28 APR 2008 09:57PM Ana Melisa Heras wrote:

Thank you Richard…I´ll try it.


At 28 APR 2008 09:58PM Ana Melisa Heras wrote:

Thank you Jim…I'll see it.


At 29 APR 2008 12:26AM ftomeo@srpcs.com's Frank Tomeo wrote:

Ana,

If you are feeling brave enough, you can use the Windows function GetVolumeInformation:

http://msdn2.microsoft.com/en-us/library/aa364993(VS.85).aspx

… declare is a function in OI, write a wrapper function around it, and it will return the HD serial number. I have it already getting the serial number for security reasons in one of our apps. Honestly, I had help from the guys in the office to get it to work correctly, but let us know if you need more info.

ftomeo@srpcs.com SRP Computer Solutions, Inc.


At 29 APR 2008 10:00AM Bob Carten wrote:

Ana

From what I read, you might want to have a "score" based on a series of tests, rather than a single pass/fail test.

For instance

if the MAC changes, then maybe they replaced a bad network card

if the HD changes, then maybe they replaced bad drive.

if they BOTH change, then they have copied to a different machine.

You can use obscure registry keys that change every so many logins, GUIDs, the microsoft encryption key in the registry and so on.


At 29 APR 2008 03:18PM Bruce Cameron wrote:

Just to chime in…

You could try and use RUNWIN with CMD and pipe SYSTEMINFO into a text file and then read it for "Product Id:" etc.

Also, straight from the OI help. I copied in this code example and changed the "Subkey" and "Key" variables and got back my desired results in the line 'Return field(QueueName," ",1)'

I am a little skeptical about the number though. It is the same value from the registry but using Windows GUI system info window my Serial# for Harddrive C: is different.

Here is the code anyway. Maybe someone can advise on piping the contents of another windows command to a file to read in OI and parse out the disk serial#

Function RegTest(Void)

declare function RegOpenKeyEx , RegCloseKey

declare subroutine RegQueryValueEx

/* equates for the base registry keys */

equ HKEY_CLASSES_ROOT$ to 0x80000000

equ HKEY_CURRENT_USER$ to 0x80000001

equ HKEY_LOCAL_MACHINE$ to 0x80000002

equ HKEY_USERS$ to 0x80000003

equ HKEY_PERFORMANCE_DATA$ to 0x80000004

equ HKEY_CURRENT_CONFIG$ to 0x80000005

equ HKEY_DYN_DATA$ to 0x80000006

equ KEY_QUERY_VALUE$ to 0x0001

equ ERROR_SUCCESS to 0x0000

options=0

samDesired=KEY_QUERY_VALUE$

KeyHandle=0

Hkey=HKEY_LOCAL_MACHINE$

* Looking for disk# HKLM\Software\Microsoft\Windows Genuine Advantage

subkey=Software\Microsoft\Windows Genuine Advantage\":\00\

stat=0

null='

LockVariable KeyHandle as Long

stat=RegOpenKeyEx(Hkey, SubKey, options, samDesired, KeyHandle)

If Stat=ERROR_SUCCESS Then

QueueName=str(\00\, 512)
Reg_SZ=1
cbBuf=512
Key=HDSLN":\00\
RegQueryValueEx(KeyHandle, Key, 0, Reg_SZ, QueueName, cbBuf)
  • call msg(@window, 'Quename=: QueueName1, cbBuf - 1)

end

rv=RegCloseKey( KeyHandle)

Return field(QueueName," ",1)

(BTW - This is from OI 8.0.3 and I did NOT run the API declarations first as mentioned in the "Reading a Registry Value" section, but the code returned the value I was expecting and wanted. I tried HDSLN, MAC etc.)


At 30 APR 2008 02:00PM Ana Melisa Heras wrote:

Thanks for your solution Bruce.

You could try RUNWIN with CMD and pipe DIR into a text file and then read the second line. Here is your Disk serial # .


At 01 MAY 2008 11:03AM Bruce Cameron wrote:

There you go, that's even more straight forward. That's what I love about OI/LH/MV systems, there is always a solution and usually the simplest is the best.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/6c93894ade5dbf8485257439006db6ca.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1