docs

Home All functions Categories

vuGetVolumeLabel(tDir)

vuGetVolumeLabel(*CSTRING), CSTRING

Description

Returns the volume label of the specified root directory. Supports both local drives and UNC paths.

Parameters

Parameter Data Type Description
tDir CSTRING(128) Path to the root directory (for example, C:\ or \\MyServer\C\).

Note: In vuFileTools V5, CSTRINGs are not limited to the size shown above. The number is for example only.

Returns

A CSTRING containing the volume label of the specified root directory.

Example

sRootPath CSTRING(4)
sLabel    CSTRING(64)
sMsg      STRING(128)

  CODE
  sRootPath = 'C:\'
  sLabel    = vuGetVolumeLabel(sRootPath)

  IF (sLabel = '<unreadable>')
    sMsg = 'Unable to retrieve volume label for: ' & CLIP(sRootPath)
  ELSE
    sMsg = 'Volume label for ' & CLIP(sRootPath) & ' is: ' & CLIP(sLabel)
  END

  MESSAGE(sMsg, 'vuGetVolumeLabel Test')

Notes

Works with both local drives and network shares.

Returns if the volume label cannot be accessed.

Ensure tDir points to a valid root directory.

Home All functions Categories