Obtaining Disk Volume Serial No (OpenInsight 32-Bit)
At 10 FEB 2004 09:30:25AM Tony Lillyman wrote:
I'm wanting to obtain the Serial Number from the Hard Drive
eg C: for use in some licencing controls I employ.
Eg The information thats returned if I did a Dir from the command
prompt
eg.
Volume in drive C is WIN2000PRO
Volume Serial Number is 1D58-1607 «< I want this bit!
Directory of C:\
Currently I achieve this by
- Creating a DOS Batch File with performs short a DIR of the
DRIVE() Folder which creates a DIRLIST.TXT File- write the batch file in to the Drive() path
- Do a Utility("RUNWIN",BatchfileName) to execture the Batch File
- then OSREAD the resulting TXT File
- and then extract the desired information from the TXT file.
When the RUNWIN execute a Window flashes up over the top of my
application.
I've looked at the RBasic references and there are routines
for GetCurrentDir and DirList() but they don't seem to get the
details I'm looking for.
There's got to be an easier way.
Any help much appreciated.
Thanks
Tony
At 10 FEB 2004 10:00AM Tony Lillyman wrote:
Sorry for being so lazy!
I found some references in the List to a rountine posted
by Steve Smith in July 03
using GETVOLUMEINFORMATIONA
I'll play with it some more.
Thanks
Tony
At 10 FEB 2004 12:36PM Richard Hunt wrote:
Tony,
I have used a similar method of copyright protection with my AREV application.
The Assembly language routine interrupt 21H…
set registers as follows…
AX=6900H
BX=0003H
DX=buffer location (32 bytes).
int 21h
So if your serial number is "CC0F-42EC" then the buffer would look like this "0000EC420FCC…" Notice it is backwards.
At 11 FEB 2004 05:17AM Steve Smith wrote:
Tony, there's a whole bunch of caveats with doing this for licencing, but basically, it's better than no protection at all.
http://www.revelation.com/__85256DC1002A4A9E.nsf/0/C9388ABE0CCBEDD385256DE1005D4374?OpenDocument