01-29-2024, 09:50 PM
(01-29-2024, 07:56 PM)MasterGy Wrote: this might work on linux and windows because it only uses internal commands.Without using error handlers and CHDIR:
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
Code: (Select All)
PRINT DriveExists("c")
FUNCTION DriveExists%% (driveLetter AS STRING)
DriveExists = _DIREXISTS(LEFT$(driveLetter, 1) + ":\")
END FUNCTION