(view source code of driverdy.bat as plain text)
@ECHO OFF
:: DRIVEReaDY -- Check if drive A: is ready
:: Written by Rob van der Woude
:: Dependencies: Needs MS-DOS 6 or up, or OS/2 Warp 4
:: May or may not work on earlier OS versions,
:: that hasn't been tested yet
::
:: Set initial value
SET AREADY=
:: Clean up old temporary files
IF EXIST DRIVERDY.DAT DEL DRIVERDY.DAT
IF EXIST DRIVERDY.TMP DEL DRIVERDY.TMP
:: Check if drive A: is ready, redirect error message to temporary
:: file, /F parameter automates "Fail" on Abort, Retry, Fail prompt
COMMAND.COM /F /C DIR A: 1> NUL 2> DRIVERDY.DAT
:: Copy temporary file; if zero bytes, copy will fail without error
IF EXIST DRIVERDY.DAT COPY DRIVERDY.DAT DRIVERDY.TMP 1> NUL 2> NUL
IF EXIST DRIVERDY.TMP SET AREADY= NOT
:: Clean up temporary files
IF EXIST DRIVERDY.DAT DEL DRIVERDY.DAT
IF EXIST DRIVERDY.TMP DEL DRIVERDY.TMP
:: Display result
ECHO Drive A: is%AREADY% ready
page last modified: 2024-04-16; loaded in 0.0104 seconds