Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Interesting drive display utility
#4
(01-29-2024, 07:56 PM)MasterGy Wrote: this might work on linux and windows because it only uses internal commands.

Code: (Select All)
On Error GoTo nodrive
For drive = 0 To 25
    drive$ = Chr$(65 + drive) + ":"
    checkdrive = 1
    ChDir drive$
    If checkdrive Then Print drive$; " is available"
Next drive
On Error GoTo 0

End

nodrive:
checkdrive = 0
Resume Next
Without using error handlers and CHDIR:

Code: (Select All)
PRINT DriveExists("c")

FUNCTION DriveExists%% (driveLetter AS STRING)
    DriveExists = _DIREXISTS(LEFT$(driveLetter, 1) + ":\")
END FUNCTION
Reply


Messages In This Thread
Interesting drive display utility - by eoredson - 12-09-2023, 06:31 AM
RE: Interesting drive display utility - by a740g - 01-29-2024, 09:50 PM



Users browsing this thread: 1 Guest(s)