I could not figure out how to format a demagnetized floppy in Windows XP. Its format functions — both GUI and command-line — just verify that the disk is readable, and if it is not, they give up and declare the diskette unusable instead of actually trying to format it. I don’t know what developers at Microsoft were thinking, but this is obviously a mistake. Or a bug. Or maybe it’s a conspiracy between diskette manufacturers and Microsoft to boost sales as people toss “not working” but still perfectly good floppies and order another box of brand new “working” ones! Just kidding.

I searched the Web for a free utility that would do what I needed, but all I could find were overpriced monsters with a myriad of useless options. It seemed as if nobody would spend an hour to create a tiny little thing that would simply format a diskette and make it useful again.

Thus frustrated, I sat down and wrote this tiny little thing myself. It honestly formats a standard 1.44 MB diskette in drive A: on any Windows PC. You can download the source code for study, improvement or including in your own projects. See compilation instructions below. I will be glad to hear your comments and answer questions, so feel free to e-mail me. This program is provided AS-IS, WITHOUT ANY WARRANTY WHATSOEVER, and source code is released under the terms of the GNU General Public License. The program does not require installation of any kind – simply double-click on the downloaded executable file.

If you already have Cygwin intalled on your PC, make sure you have gcc-core and gcc-mingw-core packages installed. Unpack the source into a directory on your hard disk. For simplicity, the following examples assume that you unpacked it into folder c:\format144
Open command prompt, change directory to c:\format144

cd \format144

then type

gcc -mno-cygwin -o format144.exe format144.c

and hit Enter. As soon as GCC finishes, your executable will be sitting in c:\format144 folder.

If you do not have Cygwin or MinGW installed, your best choice is to download and install MinGW. Go to http://www.mingw.org/download.shtml, then download and install package MinGW-3.1.0-1.exe. You should let it install into default directory, which is X:\MinGW, where X: is the drive where your Windows is installed, typically C:.

Assuming that you installed it into C:\MinGW, and unpacked format144.c into c:\format144, you can open Command Prompt, change directory to c:\format144

cd \format144

then type

\mingw\bin\gcc -o format144.exe format144.c

and hit Enter. Your executable will be in c:\format144 as soon as GCC finishes.

Once downloaded and installed, you should create a configuration file and store it in compiler’s bin directory, so you don’t have to specify include and library directories in command line. Assuming you installed the compiler into the default directory, you can download the configuration file I used on my system and save it to c:\borland\bcc55\bin folder. You should also add c:\borland\bcc55\bin directory to your system’s PATH. You can do this in Control Panel, System icon, under Advanced tab. Append a semicolon and c:\borland\bcc55\bin to the end of the system PATH variable.

To compile the program, go to Command Prompt, change to the directory where you saved the source:

cd \format144

then type

bcc32 format144.c

and hit Enter. The executable file will be saved in the same directory.