Drives - VBScript


Overview

The Drives command in VB Script returns an array of drive letters that are available on the computer. This can be useful for iterating through all drives, or for getting information about a specific drive.

Syntax

Drives()

Options/Flags

The Drives command does not have any options or flags.

Examples

' Get an array of all drive letters
Dim drives = Drives()
' Get the drive letter for the current directory
Dim currentDrive = Drives(0)

Common Issues

One common issue when using the Drives command is that it may not return all available drives. For example, network drives may not be included in the array.

Integration

The Drives command can be used in conjunction with other VB Script commands to perform a variety of tasks. For example, you could use the Drives command to iterate through all drives and check the free space on each one.

  • GetDrive
  • GetDiskFreeSpace