----^--->
/\

//\\
//The\
/Sy
stem\
////
Guard
\

In the mount of the LORD it shall be seen. Genesis 22:14

ListAvail

Booming Or Fuming? | MasterCatalog | ntlib (FREE) | NTCmdLib | MtCmds | Scripts | Almost Free | TheGuardBook | Help

 

Types of
.Mount/\Commands

.CrystalClear | .ExactName | .ExitELn | .GetValue | .ifCondition | .ifELn | .IsPattern | .ListValue | .NetValue | .NowValue | .RedirRapids | .ReliableReporting | .RestoreValue | .SetELn | .ValueEcho

.GetValue
Series

  ListAvail | ListCD | ListIPAddr | ListIPGateway | ListIPMask | ListMac | ListNic

.ListAvail

Description

  1. Lists all available drive letters [C-Z] (1 per line, no trailing ":")

Syntax

%.ListAvail%    

Parameters and Switches

none

   

Errorlevels and Output Variables

Display to
STDOUT

 

Value of
Output
Variable

 

Error
Level

  Description of Result

E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
U
V
W
Z

 

n/a

  n/a    

Examples, Notes and Instructions

NT
2K
XP
K3
C:\GuardPost>%.ListAvail%
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
U
V
W
Z
  • Output is displayed to STDOUT
  • To perform an operation on each unused drive, use %.eListAvail%.
NT
2K
XP
K3

C:\GuardPost>FOR /F %A IN ('%.eListAvail%') DO @ECHO:%A
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
U
V
W
Z


Related .Mount/\Commands, #Constants, $Functions, :Procedures

Resource

  Short Description
.ListCD   Lists the current directory of all accessible local and remote drives [C-Z]
.eListCD   escapified version of .ListCD
.eListAvail   escapified version of .ListAvail

!GuardNotes

How to get the next available drive letter into a variable

01. SET NextDrive=
02.
%.ForAll% %%D IN ('%eListAvail%') DO (
03.    IF NOT DEFINED NextDrive SET NextDrive=%%D
04. )

This will place the next available drive letter into variable %NextDrive%.  Note that there is no trailing colon.  So, for example, to map a drive:

   Net use %NextDrive%: \\Server\Share


K

E

Y

Common Commands INTERNAL External /SWITCH Parameter Help text AddonTool
Mounted Commands .Mount/\Command CmdShorthand #Constant $FUNCTION :Procedure !GuardNote
Operating Systems NT/2K/XP/K3 NT Only NT/2K 2K Only 2K/XP XP Only XP/K3 K3 Only 2K/XP/K3

.ListValue
Series

  ListAvail | ListCD | ListIPAddr | ListIPGateway | ListIPMask | ListMac | ListNic
/\
//\\
//
The\
/Sy
stem\
////
Guard
\
COME ON UP WITH US!
and
Congratulations On Your Decision
to
RISE ABOVE
THE REST!

^
/
!\
/LIB\

TheSystemGuard.com [Revised: 2007-03-29]
Copyright © 1995-2007, JWC
Computer Communications,
All Rights Reserved, Worldwide.
 Disclaimer       Privacy       About Us       More


Communication Is Business!

We Master It With Knowledge!

^
/
.\
/M^C\