Computing.Net > Forums > Disk Operating System > Batch file to check if HD formatted - overcoming A,R,F?

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Batch file to check if HD formatted - overcoming A,R,F?

Reply to Message Icon

Name: Laird Bishop
Date: April 13, 2000 at 10:59:17 Pacific
Comment:

I am attempting to add a portion to a batch file which will check to see if the c drive is formatted, and if not offer the option to format it. I am using the following sequence to attempt this:
dir a:\ > c:\test.bat
ifexist c:\test.bat goto formatted
echo Drive C: was not detected
etc.

The problem I am encountering is that the batch file is interrupted with the old "Invalid media type reading Drive C: Abort, Retry, Fail" message. Is there a way to use an errorlevel to trap this, or to pipe A into the command to automatically respond?

Thanks in advance for any help on this matter.



Sponsored Link
Ads by Google

Response Number 1
Name: me
Date: April 14, 2000 at 02:01:32 Pacific
Reply:

use echo a | command
To type "a" after the command
In this case abort is selected


0
Reply to Message Icon

Related Posts

See More


FDISK Is DOS and Win9X one and ...



Post Locked

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


Go to Disk Operating System Forum Home


Sponsored links

Ads by Google


Results for: Batch file to check if HD formatted - overcoming A,R,F?

Any Way To Check Day in Date? www.computing.net/answers/dos/any-way-to-check-day-in-date/12323.html

DOS batch to check file dates www.computing.net/answers/dos/dos-batch-to-check-file-dates/13578.html

dos batch to check file date www.computing.net/answers/dos/dos-batch-to-check-file-date/12627.html