Click to See Complete Forum and Search --> : batch file to format drive
Technichian
May 20th, 2001, 08:57 AM
I wana kno if we can format drives using batch files under dos/win9x . with drives i mean both floppy and Hard Drives. Can we create a batch files so that we dont have to input that 'Y' during format and nothing shows up on screen.
Cromicus
May 20th, 2001, 10:44 AM
I forgot how to do batch files, but try:
format c:
y
What is this for anyway?
xt477
May 21st, 2001, 09:02 AM
echo y|format a: /s /v
there is a command line switch to not prompt for y, sorry but cant remember what it is. the above will work.
more parameters follow
FORMAT drive: [/V[:label]] [/Q] [/F:size] [/B | /S] [/C]
FORMAT drive: [/V[:label]] [/Q] [/T:tracks /N:sectors] [/B | /S] [/C]
FORMAT drive: [/V[:label]] [/Q] [/1] [/4] [/B | /S] [/C]
FORMAT drive: [/Q] [/1] [/4] [/8] [/B | /S] [/C]
/V[:label] Specifies the volume label.
/Q Performs a quick format.
/F:size Specifies the size of the floppy disk to format (such as 160, 180, 320, 360, 720, 1.2, 1.44, 2.88).
/B Allocates space on the formatted disk for system files.
/S Copies system files to the formatted disk.
/T:tracks Specifies the number of tracks per disk side.
/N:sectors Specifies the number of sectors per track.
/1 Formats a single side of a floppy disk.
/4 Formats a 5.25-inch 360K floppy disk in a high-density drive.
/8 Formats eight sectors per track.
/C Tests clusters that are currently marked "bad."
Kymera
May 21st, 2001, 09:07 AM
I usually create a file with the required key strokes, then direct the file into the command. So, create a file named Format.key then put the y and the drive label in the text file. Then you batch file looks like this :
Format c: < format.key
The .Key file looks like this :
y
C-Drive
The text file can be named anything, I just use that naming convention.
SB
May 21st, 2001, 05:50 PM
format a:/autotest
The /autotest switch dont ask no questions so be careful.
SubZero
May 22nd, 2001, 06:24 AM
Why don't you check this thread:
http://forums.windrivers.com/cgi-bin/forum3/ultimatebb.cgi?ubb=get_topic&f=12&t=000090
sebass54
May 22nd, 2001, 02:12 PM
what about creating a batch file like this:
@echo off
echo y|format /v: /s
Outcoded
May 23rd, 2001, 08:16 AM
Thought it was:
|y echo format c:
bdunn
May 23rd, 2001, 10:14 AM
if you use /autotest format will go ahead and not prompt you just be CAREFUL. It even works to re-format a drive from within autoexec.bat on the same drive.