>Hi,
>I use the WIN32 API function GetVolumeInformation to get serial number of the disk where my application have been instaled. But when the application is installed on network drive this function always returns 0 as a serial number.
>
>Here is my code:
>
>WAIT WINDOW STR(GetVolumNum("P")) && 0
The share may not have a vol/ser number published, since it may bnot be based on the root of a real drive. If you absolutely insist on using this information, use the Drives collection of the Scripting.FileSystemObject; the SerialNumber property of the Drive object is correct if one is published. The following comes from the MSDN Library:
SerialNumber Property Scripting Run-Time Reference
Version 3
--------------------------------------------------------------------------------
Description
Returns the decimal serial number used to uniquely identify a disk volume.
Syntax
object.SerialNumber
The object is always a Drive object.
Remarks
You can use the SerialNumber property to ensure that the correct disk is inserted in a drive with removable media.
this code is adapted from the VB example in the MSDN docs; it illustrates the use of the SerialNumber property:
Function ShowDriveSerialNumber
LPARAMETER cDrvPath
LOCAL fso, oDrive
fso = CREATEOBJ('Scripting.FileSystemObject')
oDrive = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(cDrvPath)))
RETURN oDrive.SerialNumber