Tak for hjælpen Harald. Har lige travlt med at få mit eksamensprojekt
færdigt, så har ikke lige tid til at kigge på det her lige nu, men vil
vende tilbage hurtigst muligt...
Nu har jeg da fået min Agent til at lade være med at slette tråden
...
så er det lige nemmere at følge med...
Rene
On Tue, 7 May 2002 10:13:14 +0200, "Harald Staff" spent some time writing
this:
>OK, prøv å kombinere "driveexists" med en tilpasset versjon av denne:
>
>Option Explicit
>
>Public Declare Function GetVolumeInformation Lib "kernel32.dll" Alias _
> "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal
>lpVolumeNameBuffer _
> As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long,
>_
> lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal _
> lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As
>Long
>
>' Display the volume label, serial number, and file system name
>' of the C: drive. Note how the serial number value is manipulated to
>' display it properly.
>Dim volname As String ' receives volume name of C:
>Dim sn As Long ' receives serial number of C:
>Dim snstr As String ' display form of serial number
>Dim maxcomplen As Long ' receives maximum component length
>Dim sysflags As Long ' receives file system flags
>Dim sysname As String ' receives the file system name
>Dim retval As Long ' return value
>
>Sub test()
>' Initialize string buffers.
>On Error Resume Next
>volname = Space(256)
>sysname = Space(256)
>' Get information about the C: drive's volume.
>retval = GetVolumeInformation("C:\", volname, Len(volname), sn, maxcomplen,
>_
> sysflags, sysname, Len(sysname))
>' Remove the trailing nulls from the two strings.
>volname = Left(volname, InStr(volname, vbNullChar) - 1)
>sysname = Left(sysname, InStr(sysname, vbNullChar) - 1)
>' Format the serial number properly.
>snstr = Trim(Hex(sn))
>snstr = String(8 - Len(snstr), "0") & snstr
>snstr = Left(snstr, 4) & "-" & Right(snstr, 4)
>' Display the volume name, serial number, and file system name.
>
>MsgBox "Volume Name: " & volname
>MsgBox "Serial Number: " & snstr
>MsgBox "File System: " & sysname
>End Sub
--
Visit my website, Cerberus' Hot Spot:
http://www.geocities.com/cerberus_hotdog
Babes, hardware, and internet references...