Drives - VBScript


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.




The Drives command does not have any options or flags.


' 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.


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