Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Volume serial number
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00365631
Message ID:
00365985
Views:
13
Michael,

Code below will do what you want. Thing is, it does not work with Network drives.

FUNCTION GetDiskSerialNo

DECLARE INTEGER GetVolumeInformation IN WIN32API;
STRING lpRootPathName,;
STRING @lpVolumeNameBuffer,;
INTEGER nVolumeNameSize,;
INTEGER @lpVolumeSerialNumber,;
INTEGER @lpMaximumComponentLength,;
INTEGER @lpFileSystemFlags,;
STRING @lpFileSystemNameBuffer,;
INTEGER nFileSystemNameSize

LOCAL lnNumber, lcNumber

lnNumber = 0

GetVolumeInformation( "C:\",.NULL.,0,@lnNumber,0,0,.NULL.,0 )

lcNumber = SUBSTR(TRANSFORM(m.lnNumber,"@0"),3)

cSerialNo = LEFT(m.lcnumber,4)+RIGHT(m.lcnumber,4)
RETURN cSerialNo

JB

>>How can I get the volume serial number for my hard drive through VFP like I do when I type 'LABEL' in DOS? Thanks for any help
>
>Michael,
>
>You need an API call for this. There is one file here in the libs (author Paul Vlad Tatavu) that does just that.
>
>José
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net

CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform