|
|
|
|
-
' great
example function to check for drive
mappings and echo status
-
' to
console. Note: this function
requires the following
-
-
set
fso = CreateObject("Scripting.FileSystemObject")
-
-
function IsDriveMapped (byval
drive)
-
' use
only the letter, and not any
appending :
-
' also
and make sure it's uppercase
-
drive = ucase(left(drive,1))
-
'
assume it's not mapped
-
IsDriveMapped =
False
-
' if no
such drive, return False right now
-
if
not
fso.DriveExists(drive)
then
exit
function
-
wscript.echo drive &
":\
drive is currently mapped"
-
' get
Drive object and check its type: 3 =
mapped
-
isDriveMapped = (fso.GetDrive(drive).driveType
= 3)
-
end
function
|
|
|
|
|
|