[Show/Hide Left Column]

Drives

Purpose: Script to report on the drive letters currently available, with filtering of the drive type and various output modes, handy in batch files for processing drives of type.
Author: Ben Kent
License: Freeware
Download: Drives.vbs (18.38 Kb)

Usage C:\Packages\Batch\Drives.vbs
Checking
  Drive          The drive to check, defaults to current drive
  /IsReady       Is drive Ready, errorlevel set, 1=Online, 2=Offline, 3=Not exist
  /WaitReady:timeout    Wait until drive is ready
  /WaitOffline:timeout  Wait until drive is offline
  /Type          Return errorlevel of the type of the drive
Reporting
  /Report:mode   Report modes, sEt, Line, Simple, Verbose
  /Filter:X      Filter X=0:all [default], X>0:first X, X<0:only Abs(X)
  /Skip:type     Skip drives of type
  /Include:type  Include drives of type
  /eXclude:drive eXculde drive
  /Order:mode    Sort order, Assending, Desending
  By default all drives are considered, multiple /s, /i, /x options can be used

Drive types
  Avilable, Unknown, Removable, Fixed, Network, CD-ROM, RAM Disk
/Help or /?   This Help



Example
cscript //nologo Drives.vbs /include:Fixed /include:Network /report:set > %temp%\~drives.cmd
Call %temp%\~drives.cmd
Del %temp%\~drives.cmd
If "%Drives%"=="" Set Drives=C:\ %HomeDrive%\
ztw.exe %Drives%
Set Drives=



Contributors to this page: BenKent and benkent .
Page last modified on Sunday 15 of November, 2009 08:41:14 EST by BenKent.