batch file to format drive
Results 1 to 9 of 9

Thread: batch file to format drive

  1. #1
    Registered User
    Join Date
    Apr 2001
    Location
    East
    Posts
    17

    Post batch file to format drive

    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.
    favourite site : http://windrivers.com.
    favourite
    page :
    http://forums.windrivers.com/cgi-bin/forum3/ultimatebb.cgi

  2. #2
    Registered User
    Join Date
    May 2001
    Posts
    32

    Post

    I forgot how to do batch files, but try:

    format c:
    y

    What is this for anyway?

  3. #3
    Registered User
    Join Date
    Dec 1999
    Location
    Columbus Ohio U.S.A.
    Posts
    194

    Post

    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."
    "I may not like what you have to say, but I will defend to the death your right to say it" Voltaire.

  4. #4
    Registered User Kymera's Avatar
    Join Date
    Feb 2001
    Location
    New York, NY USA
    Posts
    1,205

    Post

    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.
    end of line.

  5. #5
    Registered User
    Join Date
    May 1999
    Location
    US
    Posts
    191

    Post

    format a:/autotest

    The /autotest switch dont ask no questions so be careful.
    (A)bort (R)etry (G)et a beer?

  6. #6
    Registered User
    Join Date
    Sep 2000
    Posts
    1,965

  7. #7
    Registered User
    Join Date
    Jan 2001
    Location
    Troy, MI, USA
    Posts
    82

    Post

    what about creating a batch file like this:

    @echo off
    echo y|format /v: /s
    "...my ties I've severed clean
    less I have, the more I gain
    off the beaten path I reign..."

  8. #8
    Senior Member - 1000+ Club Outcoded's Avatar
    Join Date
    Apr 2001
    Location
    Somewhere in the UK, never quite sure where
    Posts
    1,689

    Post

    Thought it was:

    |y echo format c:
    I'm in charge and I say we blow it up

  9. #9
    Registered User
    Join Date
    Nov 1998
    Location
    New York, NY
    Posts
    376

    Post

    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.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •