Skip navigation

JSI Tip 0801. Test If a Diskette drive is ready in a batch file.


If you need to test wether a Diskette drive is ready in a batch script, download Drvready.

The syntax is: Drvready \[<Drive:>\]

If no drive letter is specified, the A: drive is assumed.

Drvready.exe should be placed in your path. When executed, it returns ERRORLEVEL 0 if the drive is ready, ERRORLEVEL 1 if it is not ready, without causing a device not ready window to appear.

Sample usage:

goto mount%ERRORLEVEL%
@echo Mount an empty formated diskette in drive A:. Press enter when ready.
goto ready
If not exist A:\*.* goto mt
@echo Diskette in drive A: is not empty, files exist.
goto mount1

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.