Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I boot into DOS. The computer, using DI1000DD.SYS and USBASPI.SYS at boot finds the USB stick and assigns a drive letter. D: in this case. And gives me the c: prompt.
The first time I try to change to D:, I get
"Invalid media type Reading drive D"
"Abort, Retry, Fail" If I type Retry, return,everything works from there on.Now, I would like to use the autoexec.bat file to change to drive d:, handle the "invalid media type reading drive D: Abort, Retry, Fail" error by entering retry and a return then load and run a program that uses data from Drive D:.
I can't figure out how to do this. Can anybody help me out.
I found a post that recommends using a bat file from USB.ZIP but I can't find this ZIP file or the Bat file.
Thanks much
IMWESO

What version of **-DOS ?? You state O/S XP which has no MS-DOS !!
Does the version of **-DOS support reading the file system the Flash Media is formatted with ?
Last but not least the USBASPI drivers are not mature, Linux is a better solution...

Trying to change to a drive which is not ready usually results in grief. Try this in you bat:
:tryagain
dir d:
if errorlevel 1 goto :tryagain
=====================================
If at first you don't succeed, you're about average.M2

itguru
I'm playing with a little computer with a small flash drive. Using DOS 6.22. trying to do a JPG display. I need to put the pictures on a large flash drive. Ive tried formating the stick in DOS. Does not help. I still get the error.
Mechanix2Go
Could it be that easy? What I have tried so far sends me into never, never land. I've also tried walking through an errorlevel 1 and a goto but It stops and displays the error message. Never gets to the errorlevel line.
Any other ideas? Ive been trying to beat this for a week now. Don't know much about batch files.
IMWESO

Mechanix2Go
Tried this autoexec.bat
@echo off
path=c:\;c:\dos
:tryagain
dir d:
if errorlevel 1 goto :tryagain
c:\lxpic.com d:\ /13 /A /y
Boots, finds stick, assigns drive D:,
prints to screen
"Invalid media type Reading drive D"
"Abort, Retry, Fail"
I type "r". The directory of D: prints to screen then the last line of the bat runs and the program runs fine.I'm trying to run this without a keyboard. I need to find a way to get the autoexec.bat
to do it all.Or, find out why I'm getting the error in the first place. Apparently most people don't get this error.
Any help would be appreciated.
Thanks much
IMWESO

Since you said it worked after responding "R", my theory was to give it time to 'wake up'.
Try to pipe a retry:
echo r | d:
=====================================
If at first you don't succeed, you're about average.M2

Well I finally found a way to boot into my DOS program with the autoexec.bat file without getting the error message.
I found a check drive batch file on the net at---
"//home7.inet.tele.dk/batfiles/batfiles.htm".
(Left off the HTTP. Don't know what your rules are on this site.)I installed this batch file on drive C:.
ISDRIVE.BAT (The second rem line tells you to replace the 1 after the % sign with the drive letter of the drive to be checked. In my case %D without the colon.)
:: isdrive.bat
:: parm1 is drive letter without colon
@ECHO off
CTTY nul
%COMSPEC%/F/CDIR/ADH/W/-P %D: |FIND.EXE ":\" >nul
CTTY con
:: %opt%ECHO Esc[2A
IF not errorlevel=1 ECHO. drive %D valid
IF errorlevel=1 ECHO. drive %D invalid
::Then, called the batch file from within the autoexec.bat.
autoexec.bat
@echo off
path=c:\;c:\dos
call c:\isdrive.bat
c:\lxpic.com d:\ /13 /A /yThe computer boots and runs my program without stopping the batch file for an "r" input from the keyboard.
I don't know why this works but I'm tickled pink.
By the way, the LZPIC.COM program makes a great JPG slideshow on an old DOS computer.
IMWESO

I don't know why either.
Some of those comspec switches are news to me.
This bit won't do much of anything:
IF not errorlevel=1 ECHO. drive %D valid
IF errorlevel=1 ECHO. drive %D invalidTo test for equality you need DOUBLE =, like this:
IF not errorlevel==1 ECHO. drive %D valid
IF errorlevel==1 ECHO. drive %D invalid
=====================================
If at first you don't succeed, you're about average.M2

I ran isdrive.bat outside of the autoexec.bat and it returned "drive d valid"
so that line must be working. Or maybe I'm missing something.I do have one question though. Isn't this line remed out? :: %opt%ECHO Esc[2A
If not what does it do?IMWESO

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |