Format diskettes on the fly


Diskettes are almost universally reviled for being too slow and too small, yet almost everyone depends on them for backing up individual files and sharing data among computers. But formatting them is a chore. You have to open Explorer, then navigate to the floppy drive, and choose the Format command from a menu. This is where a batch file can come in handy.

If you just want to format a disk, fire up Notepad and type format a: /autotest (type b: instead of a: if that's the drive you want to use). Save the file to a desired folder as something like fmt.bat, making sure to use the three-letter .bat extension. (I keep a separate folder just for batch files.)

But be warned: The /autotest switch tells DOS to format a floppy disk without prompting you for confirmations. If you accidentally execute this batch file on a floppy containing data, use the DOS Unformat command to reverse the dire effects. Unfortunately, this rescue technique works only with Windows 3.x and DOS 6.x. If you use Windows 9x, look for the file mirror.com on your hard disk. You may have to dig out your old DOS floppies and find a file called mirror.co_. Start a DOS window (choose Start-Programs-MS-DOS Prompt), and at the C: prompt, type expand a:\mirror.co_ c:\dos\mirror.com (your path may differ), and then press <Enter>. Now open the fmt.bat file in Notepad and add the line c:\dos\mirror a: above the format line in Notepad. Mirror takes some space on the floppy, but it'll let you recover data after an unintended format.

Note that this batch file won't work with NT, nor will it allow for quick formatting. To overcome these limitations, change the format line to format a: /q < c:\windows\cr.txt (your path may be slightly different).

Caption: Start the Windows Format dialogue box from a Shortcut containing this command line

If you're not using NT, you can include the mirror line as before. Save and close the file. Now right-click an empty area of the folder identified in the command line (here, it's the Windows folder) and choose NewûText Document. Name it cr.txt. Double-click the new file to open it for editing. Press <Enter> twice to insert two carriage returns, then type N followed by <Enter> again. This will reply to the Format command's prompts. Save the file, and exit.

If you prefer to see the normal Windows Format dialogue box (Windows 9x and NT only), right-click the Start button and click Open or Explore. Double-click Programs, then navigate to the folder from which you'd like to launch the formatter. Right-click an empty area and choose NewûShortcut. In the Command Line box, type rundll32.exe shell32.dll,SHFormatDrive, taking note of the lowercase/uppercase letters as shown. Click Next and type a name for your Shortcut (such as Floppy Formatter). Click Finish. If you want, you can assign a keyboard shortcut to launch this formatter: Right-click the new icon, select Properties, click the Shortcut tab, then click in the Shortcut key field and type a letter or number. The system will automatically add "Ctrl + Alt +" to what you type, and that key combination will be your keyboard Shortcut. Whenever you want to format a floppy, just choose your new command from the Start menu or press its keyboard Shortcut.

 

û Scott Dunn


Category:Win95
Issue: March 1999

These Web pages are produced by Australian PC World © 1999 IDG Communications