How to get hard disk serial number for NT

For windows 95 and 98, I can use an API call 'GetVolumeInformationA' to get
the hard disk number of a local hard-disk.  However it does not work for NT
4.0 workstation and servers.  The serial number returned is '0000-0000'
which is incorrect.  Please advice if there is another specific API call for
getting serial number from a NT 4.0 workstation.


Tilden


0
Tilden
11/16/1999 8:28:57 AM
sybase.powerscript 7704 articles. 0 followers. Follow

3 Replies
1173 Views

Similar Articles

[PageSpeed] 48
Get it on Google Play
Get it on Apple App Store

That function is supposed to work on NT as well.  However, the function itself
has a bug with regard to reporting the serial number for remote drives.  You
might want to look at:

http://support.microsoft.com/support/kb/articles/Q234/7/41.ASP

which describes the problem and the workaround.

On Tue, 16 Nov 1999 16:28:57 +0800,
 in powersoft.public.powerbuilder.powerscript
Tilden Lau <tildenl@koffman.com.hk> wrote: 
>For windows 95 and 98, I can use an API call 'GetVolumeInformationA' to get
>the hard disk number of a local hard-disk.  However it does not work for NT
>4.0 workstation and servers.  The serial number returned is '0000-0000'
>which is incorrect.  Please advice if there is another specific API call for
>getting serial number from a NT 4.0 workstation.
>
>
>Tilden
>
>

---
Bruce Armstrong [TeamSybase]              | Romac International
mailto:Bruce.Armstrong@teamsybase.com     | http://www.romac.com
Watch for the KFORCE ad in the SuperBowl! | http://www.kforce.com

Preach the gospel at all times. If necessary, use words. [Francis of Assisi]
http://www.kidbrothers.org                | http://www.fccwc.org
http://www.harvest.org/knowgod/index.htm  |

-----------== Posted via the PFCGuide Web Newsreader ==----------
http://www.pfcguide.com/_newsgroups/group_list.asp
0
Bruce
11/16/1999 8:41:48 PM
Hi,

This is what we have:


/*external declaration*/

FUNCTION boolean GetVolumeInformationA( ref string lpRootPathName,ref string
lpVolumeNameBuffer,long nVolumeNameSize,ref uint lpVolumeSerialNumber[2],
ref long lpMaximumComponentLength, ref long lpFileSystemFlags,ref string
lpFileSystemNameBuffer,long nFileSystemNameSize  ) library 'kernel32.dll'


/* our function */
function GetVoluneInfo ( as_drive string, as_label string by ref, as_serial
string by ref) return integer

/* This function will return the serialnumber of a specified volume */

string  lpRootPathName    // address of root directory of the file system
string  lpVolumeNameBuffer  // address of name of the volume
long   nVolumeNameSize    // length of lpVolumeNameBuffer
uint  lpVolumeSerialNumber[2]  // address of volume serial number
long   lpMaximumComponentLength // address of system's maximum filename
length
long   lpFileSystemFlags    // address of file system flags
string  lpFileSystemNameBuffer  // address of name of file system
long   nFileSystemNameSize    // length of lpFileSystemN


lpRootPathName = as_drive
lpVolumeNameBuffer = space(255)
nVolumeNameSize = 255
SetNull(lpFileSystemNameBuffer)

if not GetVolumeInformationA(&
 lpRootPathName,&
 lpVolumeNameBuffer,&
 nVolumeNameSize,&
 lpVolumeSerialNumber,&
 lpMaximumComponentLength,&
 lpFileSystemFlags,&
 lpFileSystemNameBuffer,&
 nFileSystemNameSize) then

 return -1
end if

/* use PFC numerical service to convert hex to string */
nv_numerical lnv_num

as_Label = lpVolumeNameBuffer
as_Serial = upper(lnv_num.of_Hex(lpVolumeSerialNumber[2]) + '-' +
lnv_num.of_Hex(lpVolumeSerialNumber[1]))

return 1

HTH
--

Gegroet

- Eric Aling [TeamSybase], Cypres Informatisering, The Netherlands
  Eric's Home & PB Site @ http://utopia.knoware.nl/users/cypr115

Tilden Lau <tildenl@koffman.com.hk> schreef in berichtnieuws
De1QX0AM$GA.215@forums.sybase.com...
> For windows 95 and 98, I can use an API call 'GetVolumeInformationA' to
get
> the hard disk number of a local hard-disk.  However it does not work for
NT
> 4.0 workstation and servers.  The serial number returned is '0000-0000'
> which is incorrect.  Please advice if there is another specific API call
for
> getting serial number from a NT 4.0 workstation.
>
>
> Tilden
>
>


0
Eric
11/19/1999 8:49:23 AM
Tilden,

I use a C++ wrapper to get this information but it's still fundamentally the
same as the other 2 respondants.  This works fine for me also on NT and
95/98.

One word of caution.  We were using this number to uniquely identify our
users for some internal processes but if the customer uses "ghosting" to
make clones of a standard "reference" PC then all those PC will have the
same Serial Number for their C drive.

Hope this helps.



0
Norm
11/22/1999 4:59:00 PM
Reply:

Similar Artilces:

Get Hard Disk Serial Number Delphi XE3
I have been using this great component from Devlib for many years in D7, D2010 and XE2 http://www.devlib.net/tgetdiskserial.htm The Delphi XE3 VCL installs without problem, but in an application the GetDiskSerial registrations are not recognised and Delphi... crashes (Close down)! They claim it works but not on my computer. Please install this and report if it works on your Delphi XE3 system? > {quote:title=Pieter van Wyk wrote:}{quote} > Please install this and report if it works on your Delphi XE3 system? I looked as far as the 'buy' button and just started laughing...

Need code to get hard disk serial number
Does anyone have a working piece of PowerScript code to read the hard disk volume serial number under Win95? This is the eight character string (such as '3733-1ED8') that you see when you run the ChkDsk command. Thanks in advance, Justin - Remove the X from my reply to address! - Justin Purington jnp@mottthehoople.mv.com - Use this API function GetVolumnInformationA( ) This function returns information about the harddrive. Global External Function: FUNCTION boolean GetVolumeInformation(ref string lpRootPathName,ref string lpVolumeNameBuffer,ulong nVolu...

How to get the hard disk serial number of a network drive?
I know that there is a function called 'GetVolumeInformationA' and with this funcion, I can get the serial number of a local drive. However when I change the local drive to network drive (say Z:) as below: lb_ret = GetVolumeInformationA("Z:\", VolName, Len(VolName), VolSerial, MCompLen, VolFlgs, VolFileSys, Len(VolFileSys)) 0 instead of a proper serial number is returned as the VolSerial. Please advise! Tilden Lau Doesn't the solution given for the local harddrive on wednesday work on the network? -Charles Tin wrote: > I know tha...

Getting MAC address or Serial number of Hard disk
Hi, I would like to track whether my client come back my site or not. Is it possible to get MAC address or Serial Number of hard disk of client PC accessing our site?ThanksTran Hong Quang There is no direct way of doing this in ASP.NET. However, you could use WMI in ASP.NET, and I beleive WMI can tell you that information.Cheers,       Kevin JonesMy Blog...

Get Hard disk serial no.
Hi, I have a requirement, where I need help. We are developing a VB application, where I need to avoid users from misusing the application. So we track the serial no of the hard disk on which he has installed the program. But the issue here is that we are not able to get the actual Harddisk number of the system from where we are running the application. We are making use of an OCX file and try to get the Serial No. This OCX returns the serial no of the hard disk on which the application is developed on. But if the same app is run from a differnt system as an exe, then it returns the sl...

Hard Disk Serial Number
Hi All, I there any one who can tell me how to get a Hard Disk Serial number(Volum Number). Thanks PS: I am really appreciate if you could give me the code. GetVolumeInformationA. Here's the declaration for it: FUNCTION boolean GetVolumeInformationA( string lpRootPathName, // address of root directory of the file system REF string lpVolumeNameBuffer, // address of name of the volume ulong nVolumeNameSize, // length of lpVolumeNameBuffer REF ulong lpVolumeSerialNumber, // address of volume serial number REF ulong lpMaximumCompon...

Getting the FLoppy Disk Serial Number ?
Hi! How can I Get the floppy Serial Number ? I'm using the GetVolumeInfoA WIndows Api but even all drivers (A:,c:,cd-rom) always return 0 Declaring local external function FUNCTION boolean GetVolumeInformationA(ref string lpRootPathName,ref string lpVolumeNameBuffer,ulong nVolumeNameSize,ref ulong lpVolumeSerialNumber,ref ulong lpMaximumComponentLength,ref ulong lpFileSystemFlags,ref string lpFileSystemNameBuffer,ulong nFileSystemNameSize) Library "kernel32.dll" boolean rtn string lprootpathname = "a:" string lpVolumeNameBuffer = space(256)...

Get Hard Drive Serial Number
Hi,Is it possible for me to get the hard drive serial number of the client's machine in my web application?Thanks I wouldn't think so, since ASP.Net is a server side language - and I would shudder with fear if this were actually possible.....David WierMCP/ASPInsiderASPNet101.com - where to look first!Please Vote for ASPNet101 - 'Best Community Resource'!Control Grouper - easily control properties for multiple controls with one control!Calendar Express - The Best HTML Calendar Generator on the web!(Please 'Mark as Answer' when it applies) Yes, I am now realizing ...

Getting the hard drive serial number
Is there an easy way to obtain the hard drive serial number (the factory ID, not the one created by windows). Thanks Michael Michael Gurnett <> wrote: >Is there an easy way to obtain the hard drive serial number (the factory ID, not the one created by windows). Google is your friend. http://www.google.com/search?hl=en&q=hard+drive+serial+number The only "easy" way would be to download a library that does it for you. http://www.diskserialnumber.com/ DiskID32: Code and interesting links near bottom of page http://www.winsim.com/diskid32/diskid32.html ...

Get real serial no. for hard disk
Hi all how can I get the real serial no for hard disk, I know there is API function called GetVolumeInformation but I want the real serial no. how can I get it I am using PB11.5 and ASA11 thanks finestraco http://www.rgagnon.com/pbdetails/pb-0214.html You will need to change the definition to GetVolumeInformationW instead of GetVolumeInformationA because PB 10+ is Unicode. -- Report Bugs to Sybase: http://case-express.sybase.com/cx/welcome.do Product Enhancement Requests: http://my.isug.com/cgi-bin/1/c/submit_enhancement <finestraco> wrote in message news:4c0a...

How to getting the Hard Disk Serial no? not the Volume Drive no!
Hi all, Any ideas to getting the physical Hard Disk Serial no? not the calling function GetVolumeInformation! Thanks~! > {quote:title=Kent Foong wrote:}{quote} > Hi all, Any ideas to getting the physical Hard Disk Serial no? > not the calling function GetVolumeInformation! A two-second Google search on "Delphi hard disk serial number" (without the quotes) found dozens of hits. Here's the first one: http://delphi.about.com/od/windowsshellapi/a/volumeserial.htm Kent Foong wrote: > Hi all, Any ideas to getting the physical Hard Disk Serial no? > not ...

Real serial number of IDE hard disk?
Hi, I want to get manufacturer's harddisk serial number (note: not" volume serial number"), because with formating it doesn't change. I have searched the newsgroup archives at: codenewsfast.com and groups.google.com; but to no avail. I am not looking for the use of GetVolumeInformation for getting the "hard disk serial number", because what this function actually gets is the volume serial number, not the manufacturer's hard disk serial number. The volume serial no. is assigned and changed during the formatting of the partition. A proper/working code...

I would like to read the hard disk serial number of a visitor
Hi, I would like to read the hard disk serial number of the people logging in to my web site. I have a web site where it gives info (market update) for a subscription fee. And I offer free demo for 15 days, however some people do not pay the fee and keep on signing in as demo user. I have tried cookies and sending small identification files but people are smart and they find these files and erase them. I need to get a unique number from their PCs where they can not change it easily like the serial number of the hard disk or another hardware device. Any suggestions or alternat...

The trick to get the real serial number of hard drive
I have just published a blog post about a solution that works both in XP and Vista under user account privilage without using P/Invoke. Everyone knows how to get serial number of hard drives but it took me over 50 hours to figure out how to do it in .Net without any user privilage problem. Here is the direct link to the blog entry. Happy Coding! Very cool stuff, you are to be commended for your hard work digging up these details and how to leverage them.Chris LoveASP.NET 2.0 Your Visual Blueprint for developing Web Applications Not bad at all. Now, if you really want to take it to &q...

Web resources about - How to get hard disk serial number for NT - sybase.powerscript

Serial - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

Serial Innovation
This is a very interesting site done by Brendan Steidle. He doesn’t just point out problems with a company or industries, he tries to offer solutions ...

Serial Podcast season two launches online
Serial, the world's most popular podcast, has launched into its second season.

Serial review: the smash-hit podcast is back with a fresh mystery
The breakout podcast of 2014 has relaunched with little fanfare. Is it any good?

Season 2 of the hugely popular (and compelling) podcast Serial now available on iTunes
Serial was one of the most compelling podcast series I’ve ever listened to, and was directly responsible for my sleep deprivation in the week ...

Season two of the gripping podcast Serial is now available
From the creators of The American Life and hosted by Sarah Koenig, the popular podcast Serial began last year. Telling a true story surrounding ...

A Serial Rapist Gets His Due
Some good news for a change : It took 45 hours over the course of four days for an all-white jury in Oklahoma City to decide whether or not ...

Bowe Bergdahl speaks for the first time in popular "Serial" podcast - Videos - CBS News
The popular podcast "Serial" started its second season Thursday by introducing the story of Army Sergeant Bowe Bergdahl The podcast is the first ...

Bowe Bergdahl on 'Serial': Exploring the moral fault lines?
Bergdahl, a kidnapped US soldier held for five years by the Taliban, has earned fierce scrutiny for his decision to leave post. A popular podcast ...

Oklahoma serial rapist cop convicted, media couldn't care less
Former Oklahoma police officer Daniel Holtzclaw was convicted Thursday on 18 of 36 charges of rape and sexual assault against 13 black women ...

Resources last updated: 12/16/2015 4:20:20 AM