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

No comments:

Post a Comment