%_DRIVE(EX) - expansion


Staff member
May 14, 2008
%_DRIVE(EX) - expansion

I use the following alias to disconnect all network drives:

for %f in (%_drives) do if %@drivetype[%f] eq 4 net use %f /d

But mapped, but unavailable drives are not included in this list, perhaps by design.

The problem is that network drives that are mapped, but unavailable is not included in the list returned by %_DRIVE.

I am not sure if this is by design.

Since I noticed two functions, %@DRIVE + %@DRIVEEX, I ask for the following:

%_DRIVE to include all letters shown by NET USE command
%_DRIVEEX to do it, and %_DRIVE to remain unchanged.

The "unavailable drives" returned by NET USE are J: and L: - those are not included in the %_DRIVE list, but K: is included.

Sample NET USE status:

New connections will be remembered.

Status Local Remote Network

Unavailable J: \\\AiDisk_b1 Microsoft Windows Network
OK K: \\im04\c$ Microsoft Windows Network
Unavailable L: \\auto02\d$ Microsoft Windows Network

Stein Oiestad on November 10, 2012 00:37