Pages

Showing posts with label check drive letter in use using script. Show all posts
Showing posts with label check drive letter in use using script. Show all posts

Thursday, 2 August 2012

Check Drive Letter in Use - VBScript



Dim Wdrive
Set FileSystemObject = wscript.CreateObject("scripting.FileSystemObject")
Set Drives = FileSystemObject.Drives 'Create a drives collection

For Each DiskDrive in Drives
DriveLetter = DiskDrive.DriveLetter
If DriveLetter = W Then
Wdrive = True
wscript.echo "W Mapped"
End If
Next