Skip navigation

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

Downloads
drvready.zip

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:

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

Hide comments

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.
Publish