Loading ...
Sorry, an error occurred while loading the content.
 

Automating Format.com

Expand Messages
  • untg@yahoo.com
    It seems like a simple issue, but I reckon it is unsolvable. Does anyone have a way I can automate format.com (in any way) so that it goes straight through
    Message 1 of 2 , Oct 31 10:20 PM
      It seems like a simple issue, but I reckon it is unsolvable. Does
      anyone have a way I can automate format.com (in any way) so that it
      goes straight through with no user-intervention? Thanks
    • Michael Marquart
      ... Here is all you ever wanted to know about format, taken from MUF17 (Microsoft Undocumented features): 17) FORMAT EDITOR S NOTE: This section contains a
      Message 2 of 2 , Nov 1, 2001
        On Thu, 01 Nov 2001 06:20:56 -0000, untg@... wrote:

        >It seems like a simple issue, but I reckon it is unsolvable. Does
        >anyone have a way I can automate format.com (in any way) so that it
        >goes straight through with no user-intervention? Thanks

        Here is all you ever wanted to know about format, taken from MUF17
        (Microsoft Undocumented features):


        17) FORMAT

        EDITOR'S NOTE:

        This section contains a discussion about how one may format a
        disk(ette)s by the quickest means available. It is most difficult
        to separate the various suggestions as the discussion blends from
        one proposed method into the next, please bear with the text.

        FORMAT A: /AUTOTEST

        The autotest parameter will allow format to proceed, checking
        existing format (unless the /u parameter is also present) and
        proceeding with the format.

        All this will take place with no delay and no waiting for user
        input. It will also end without pausing. It will not ask for
        a volume label or whether to format another diskette.

        WARNING! This procedure will also work on hard drives! Be very
        cautious if you plan to use this feature.

        Wayne Woodman


        FORMAT/U is not available in DOS 3.30

        Mitch Ames


        It won't take any other switches like /U, /S or /Q which is
        a bit of a shame really.

        When I try it with Dos6 I get the following error message:

        Parameters not compatible.
        Format Terminated.

        Peter Lovell


        /U and /S both work together with /AUTOTEST with my copy of
        MS-DOS 6.00. Did you possibly use an illegal combination of
        switches?

        John Evans


        With Dos 5 it certainly takes /u and /s as I have used it, in
        fact I think /u is required if the disk is not pre-formatted
        as the drive hangs up otherwise.

        I would agree about /q though, this does not work and gives
        the error message you quote.

        Terry Kreft


        Have you ever tried:

        FORMAT A: /Q /U /AUTOTEST

        Pete Dinnella


        This doesn't work in my DOSs (IBM DOS 5.02 and OS/2). You can't
        combine /Q AND /AUTOTEST

        Asbjorn Hojmark


        I have loaded my F5 key with ANSI.SYS so when I press it I get

        FORMAT A: /F:720 /U /AUTOTEST

        This DOES work.

        Pete Dinnella


        EDITOR'S NOTE: In response to requests for the fastest way to
        format diskettes. Vernon Frazee has offered the following
        solutions. These techniques generated a great deal of
        discussion pertaining to the validity and relative merits of
        each method.

        REN /?|FORMAT %1 /q /u /v:"%2">NUL

        Most of the solutions I've created and used, or seen... echoed
        the necessary responses out to a temporary file, redirect the
        contents of that file back to the FORMAT command, and then deleted
        the file. Inefficient!

        If you type the command:

        format a: /q /u /v:""

        FORMAT will 'quick format' a diskette in A:, unconditionally, and
        without prompting for a volume label, which is all well and good,
        BUT for many, the two prompts:

        Insert new diskette for drive A:
        and press ENTER when ready...

        and then:

        QuickFormat another (Y/N)?

        get real old after a while. We DON'T have time to play. We wanna
        slam a disk in the drive, hit a few keys and have a formatted disk
        ready to go... now! <g>

        The solution of course is some way to send a "carriage-return"
        response to the first prompt, and then a "N" and "carriage-return"
        to the second. And, like I stated above, most use a temporary
        file to store these keystrokes and then delete it.

        Well check it out. If you're using MSDOS v5.00 or higher (haven't
        tried it with anything earlier yet) stick a previously formatted
        diskette in drive A: and try the following command:

        ren /?|format a: /q /u /v:""

        and the text generated by the "REN /?" portion of the command lands
        you back at the DOS prompt no questions asked! Yea yea, I know, the
        output is ugly but hey, it works! If you'll simply add a ">nul"
        (not the quotes) to the end of the line it'll hide the mess.

        Here's my QF.BAT(ch) solution built around the above:

        @echo off
        :QF.BAT - Quick Formats diskette in specified drive (with
        : optional volume label). Type "QF /?" for syntax
        for %%x in (a A b B) do if (%1)==(%%x:) goto BEGIN
        for %%x in (a A b B) do if (%1)==(%%x) QF %1: %2
        :Syntax .................................................
        echo Syntax: QF d[:] [volume_label]
        echo Where: d is either drive A or B, (":" optional)
        echo and: volume_label is an optional volume label
        goto END
        :BEGIN ..................................................
        echo Quick formatting diskette in %1...
        if not (%2)==() echo and adding label "%2"
        ren /?|format %1 /q /u /v:"%2">nul
        echo Task complete.
        :END .............................................. -vjf-

        If you'll stick the above in a directory in your PATH all you have
        to do to 'quick format a diskette in A:' is type:

        QF A

        (or "QF B") and you'll have "no questions ask" formatted diskette
        ready to go in 7-8 seconds.

        Vernon Frazee


        EDITOR'S NOTE: This shorter version of QF.BAT eventually evolved
        into the following:

        "a BATch file named QF (Quick Format) that ONLY allows formatting
        diskettes in drive A: or B:. The entire BATch file is built around
        the single command (which I use in a DOSKEY macro instead of a
        BATch file):

        ren /?|format %1 /q /u /v:"%2">nul

        Here's my QF.BAT solution (again):

        @echo off
        :QF.BAT v1.1 -----------------------------------------------------------
        :Purpose: Quick Formats diskette in specified drive (with
        : optional volume label). Type "QF /?" for syntax
        for %%x in (a A b B) do if (%1)==(%%x:) goto BEGIN
        for %%x in (a A b B) do if (%1)==(%%x) QF %1: %2
        :Syntax ----------------------------------------------------------------
        echo Syntax: QF d[:] [volume_label]
        echo Where: d is either drive A or B, (":" optional)
        echo and: volume_label is an optional volume label
        echo Note: DOS's CHOICE.COM is used if an error occurs
        goto END
        :BEGIN -----------------------------------------------------------------
        echo Quick formatting diskette in %1...
        if not(%2)==() echo and adding label "%2"
        ren /?|format %1 /q /u /v:"%2">nul
        if errorlevel 4 goto ERROR
        if errorlevel 3 echo Task terminated.
        if errorlevel 3 goto END
        if errorlevel 0 echo Task complete.
        if errorlevel 0 goto END
        :ERROR -----------------------------------------------------------------
        echo.
        echo Error reading drive %1!
        echo.
        echo a) Is the disk inserted correctly and the drive door closed?
        echo b) Maybe the disk is write-protected or "%1" is the wrong drive?
        echo c) Has the disk in drive "%1" ever been formatted before?
        echo (QF won't work on a disk that's never been formatted).
        echo.
        choice /c:ar Your choice: Abort or Retry
        echo.
        if errorlevel 2 goto BEGIN
        echo Task aborted.
        :END ------------------------------------------------------------- -vjf-"

        Vernon Frazee


        EDITOR'S NOTE: In response to these suggestions Vernon received
        the following feedback:


        If you type the command:

        format a: /q /u /v:""

        FORMAT will 'quick format' a diskette in A:, unconditionally, and
        without prompting for a volume label, which is all well and good,
        BUT for many, the two prompts:

        Vernon Frazee


        Have you ever tried:

        FORMAT A: /Q /U /AUTOTEST

        The undocumented /AUTOTEST switch will not ask you to insert a
        disk nor will it ask for a volume label or if you want to format
        another! I have loaded my F5 key with ANSI.SYS so when I press
        it I get

        FORMAT A: /F:720 /U /AUTOTEST

        (I use a lot of 720k 3.5's) Now with the press of a single key I
        pump out a 720 floppy pretty damn quick! Try it! P.S. I know this
        works with DOS 6.0. Don't know about 5.0 and below!

        Pete Dinnella


        I did... on every version of MS-DOS since 4.0. And neither of the
        undocumented FORMAT parameters, "/AUTOTEST" or "/BACKUP" will work
        with the "/Q" parameter. In fact both return the same error message:

        format a: /q /u /v:"" /autotest

        and,

        format a: /q /u /v:"" /backup

        return the error:

        Parameters not compatible.
        Format terminated.

        Vernon Frazee


        Question, Why not redirect a text file with the necessary
        keystrokes in it to the format command?

        William Johnson


        1) If you store the "text" file on the hard drive permanently it's:

        a) Wasting a minimum of one cluster and
        b) You have to wait for DOS to find and read the file
        (so it can redirect it to the FORMAT command)

        2) If you are echoing the keystrokes out to the "text" file instead,
        you have to wait for:

        a) DOS to write the file
        b) DOS to find and read the file (to redirect it to FORMAT)
        c) DOS to delete the file

        Vernon Frazee


        You did great down to here, Vernon! The rest is wrong.

        VF> ren /?|format a: /q /u /v:""

        is faster because it uses REN (a DOS command already in memory).
        (It doesn't have the additional delay of reading and/or writing
        the extra "text" file to and/or from a slow mechanical disk).

        To test what I'm saying, Vernon, use a .BAT such as this:

        @echo off
        set xemp=%temp%
        set temp=a:\
        ren/?|format b:/q/u/v:""
        set temp=%xemp%
        set xemp=

        If you want to read the output of REN/? from drive A:, just
        UNDELETE the newest file on drive A: and read it. If I remember
        right, the pipe puts TWO temporary files on disk that have to be
        deleted. One of those is zero length and can't be read but it's
        still an additional file that must be written and subsequently
        deleted from the disk.

        It seems that this should be covered in the DOS manual but if it's
        there, I've never seen it.

        Billy Gilbreath


        EDITOR'S NOTE: In response to another suggestion from Vernon Frazee.


        FORMAT A: /Q /U /S /V:"" /F:1.2

        Vernon Frazee


        /Q and /U are mutually exclusive options. Actually, it just kind
        of ignores the /q. Also putting the "/U" is really unnecessary
        unless you have reason to suspect bad media. If "/Q" cannot
        determine the media type, it defaults to "/U" format.

        Steve Adams


        /Q is not kind of ignored at all.
        /U is by no means unnecessary, if you do not use it then format
        will check the disk and save the "Unformat" information, this
        takes time, try doing a quick format with /U and without it, the
        difference in processing time is significant.

        Also /Q does not "default" to /U format, it asks for user input
        as to whether it should proceed with an unconditional format,
        sometimes!

        Following this message I spent two hours playing around with
        FORMAT, and the number of responses it gave to differing
        conditions was quite remarkable.

        For instance when I said that /Q does not default to /U but
        requires user input sometimes I was referring to the following
        cases:

        MSDos 6.20, 1.44m floppy drive:

        1.44m floppy disk, unformatted.

        Command line> FORMAT A: /V:"" /Q /F:1.44

        The user is _not_ asked whether to carry out an unconditional
        format, FORMAT just carries on and does it.

        720k floppy disk, unformatted.

        Command line> FORMAT A: /V:"" /Q /F:720

        The user is _not_ asked whether to carry out an unconditional
        format, FORMAT just carries on and does it.

        So what does the following command line do (1.44m floppy disk):

        Command line> FORMAT A: /V:"" /Q

        You would think that this should work the same as example (1)
        above as the /F:1.44 should be implied. It doesn't, the user
        is _asked_ whether to perform an unconditional format, it does
        not just carry on and perform one.

        I found a number of anomalies in the way format handled different
        disk sizes in the above set-up and the conclusion I reached was
        that it was unsafe to reach a conclusion on _anything_ format
        will do, without trying the specific situation out first.

        The one thing I did find though was that /U gives significant
        speed improvements in all situations (maybe! <G>).

        Why do you use the /f switch with format /q as it is redundant,
        the /q forces the disk size to be retained anyway. Please see
        below for a test of this I did.

        DOS screen capture Comments
        ============================================ ========
        C:\format a: /q /u /v:"" /f:1.44 +- Note /f:1.44
        Insert new diskette for drive A: |
        and press ENTER when ready... |
        |
        Checking existing disk format. |
        QuickFormatting 720K +- Note its actually
        Format complete. | formatting to 720k
        | as this was the
        | original disk
        730,112 bytes total disk space | size.
        730,112 bytes available on disk |
        |
        1,024 bytes in each allocation unit. |
        713 allocation units available on disk. |
        |
        Volume Serial Number is 3F2D-13DE |
        |
        QuickFormat another (Y/N)?n |
        |
        C:\ +- Done

        So as I say the /f is redundant.

        Terry Kreft



        FORMAT C: /BACKUP


        This week I've read some articles in Dutch computer magazines about MUF's
        which are very interesting (if you don't already know about them).

        I already knew the FORMAT option /AUTOTEST, but new to me was the
        /BACKUP option.

        EXAMPLE: FORMAT A: /BACKUP

        It seems to work exactly like /AUTOTEST, but it DOES ask for a volume
        label.
        Willem Van.den.broek


        FORMAT/SELECT/U

        is like DOS-Mirror... for safety-fanatics only

        FORMAT/SELECT/U

        makes disks unreadable (remember the U)

        Reinhard Kujawa
        Info from The German magazine PC PRAXIS


        FORMAT /SELECT calls MIRROR after formatting.

        Patrick Feisthammel


        Here's a rough translation of what my DOS6 book (written by
        Hans C. Nieder) says about it:

        /SELECT/U This is a very dangerous option. Within 1 to 2 seconds,
        and without further prompting, the disk(ette) will be
        unformatted in such a manner as to make recovery
        impossible. This might prove useful for reasons of
        data protection, e.g. destroying sensitive data.

        John Evans


        FORMAT /H

        In DOS 3.30 (I don't know about other versions), FORMAT /H
        will cause the format to begin immediately after pressing Y
        in response to "Format another?", rather than displaying
        "Place disk to be formatted in drive A: and press Enter" on
        a second and subsequent disks.

        Mitch Ames


        On 5.0 it comes back as "invalid switch".

        John Mudge
      Your message has been successfully submitted and would be delivered to recipients shortly.