hi all. could sumone plz help me out with a script that, a, ask for a drive letter b, displays the type of drive c, displayes its state (rdy or not rdy) d, displays its serial no. e, if no drive letter is entered or u hit esc or cancel the script should exit , saying no drive letter was entered. i have looked everywhere for a script like this but havent found any many thx in advance
Here's you script :smile: Code: ' First creat an FSO object Set FSO = CreateObject("Scripting.FileSystemObject") ' Drive specifications Dim Drv, DrvType, DrvName, DrvReady ' Get and format the drive name InputBox("Please enter drive letter :", DrvName) If Len(DrvName) > 1 Then DrvName = Left(DrvName,1) ' Check if user clicks "Cancel" If DrvName = "" Then End ' Continue :) Drv = FSO.GetDrive(DrvName) Select Case Drv.DriveType Case 0: DrvType = "Unknown" Case 1: DrvType = "Removable" Case 2: DrvType = "Fixed" Case 3: DrvType = "Network" Case 4: DrvType = "CD-ROM" Case 5: DrvType = "RAM Disk" End Select If Drv.IsReady Then DrvReady = "Ready" Else DrvReady = "Not Ready" MsgBox "Drive = " & DrvName & VbCrLf & "Drive Type = " & DrvType & VbCrLf &_ "Drive State = " & DrvReady & VbCrLf & "Volume Name = " & Drv.VolumeName