@echo off
rem qdrvl.bat
echo E100 A0 5C 00 B4 4C CD 21> %temp%\qdrvl.dis
echo Rcx>> %temp%\qdrvl.dis
echo 7 >> %temp%\qdrvl.dis
echo w >> %temp%\qdrvl.dis
echo q >> %temp%\qdrvl.dis
echo create>%temp%\qdrvl.com
debug %temp%\qdrvl.com<%temp%\qdrvl.dis >nul
%temp%\qdrvl.com %1
if errorlevel 243 goto isnumbercolon
if errorlevel 1 echo valid drive
if not errorlevel 1 echo Not a valid drive
goto exit
:isnumbercolon
echo number followed by colon detected!
:exit
::del %temp%\qdrvl.com
del %temp%\qdrvl.dis
though it seems the com parser is a bit crude and allows $: and £:
(X-posted to amb)
Esra, while I appreciate your intention to help, I was asking for a
more elegant solution than my original one, which was just a few lines
in a BAT file. A debug script to generate a 16-bit DOS COM file (which
is only supported under 32-bit Windows for backwards compatibility) is
not, in my opinion, more "elegant" than I had.
Regarding the cross-post, I would prefer that discussion be constrained
to the forum in which I posted the question. I am not interested in
supporting MS-DOS anyway.
- Rich
One might use XSET 's "DRIVETEST" feature to determine if a parameter
is a valid drive.
The syntax is:
XSET TEST DRIVETEST A:
This will assign a variable to "TEST" such as:
READABLE
WRITEABLE
REMOVABLE
INVALID
...and a number of others. One could then test that variable for a
variety of outcomes.
One or more XSET links can be found at:
http://www.chebucto.ca/~ak621/DOS/Websites.html
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/
> (For some reason no original post appeared on my serevr. As such, this
> suggestion may not be valid for the purpose.)
The original post was in microsoft.public.win2000.cmdprompt.admin
The cross-post to alt.msdos.batch was inappropriate.
> One might use XSET 's "DRIVETEST" feature to determine if a parameter
> is a valid drive....
Thank you, but the question was about doing it in a BAT script. I was
not looking for anything requiring an external executable helper app.
- Rich
> Richard Bonner wrote:
> > (For some reason no original post appeared on my serevr. As such, this
> > suggestion may not be valid for the purpose.)
> The original post was in microsoft.public.win2000.cmdprompt.admin
> The cross-post to alt.msdos.batch was inappropriate.
*** Odd though that the cross-post did not appear on my server.
Normally, they do.
> > One might use XSET 's "DRIVETEST" feature to determine if a parameter
> > is a valid drive....
> Thank you, but the question was about doing it in a BAT script. I was
> not looking for anything requiring an external executable helper app.
> - Rich
*** OK. I am a big fan of using whatever is available and can do the
job, but understand if some cannot, or choose not to, use after-market
utilities.
I hope you locate what you need.
Richard Bonner
http://www.chebucto.ca/~ak621/DOS/