@ECHO OFF
IF [%1]==[] goto usage
IF [%2]==[] goto usage

ECHO Formatting floppy and copying system files over to it.
ECHO Please insert a floppy into drive %2
ECHO WARNING!!! All contents on floppy [%2] will be lost!
ECHO Press Ctrl-C / Ctrl-Break to abort.
PAUSE
%1\FREEDOS\FDOS\BIN\FORMAT %2 /V:FDOSB8H1 /Q
%1\FREEDOS\FDOS\BIN\SYS FLOPPY\ %2

ECHO Copying remaining files to floppy.
MKDIR %2\CONFIG > NUL
COPY FLOPPY\*.* %2 > NUL
COPY FLOPPY\CONFIG\*.* %2\CONFIG > NUL

ECHO Please copy your CD-ROM drive's DOS driver to %2
ECHO and edit %2\CONFIG.SYS to match, then reboot
ECHO with the floppy and things should work similar
ECHO to booting from CD (don't write protect the floppy).

GOTO END

:usage
ECHO USAGE: %0 CD_drive Floppy_drive
ECHO For example:   %0 D: A:
ECHO Assumes your CD-ROM drive is D: and you wish to
ECHO create a bootable floppy disk in your A: drive.
ECHO Change D: and A: as appropriate.
ECHO It will then format, sys, and copy files to the floppy.
ECHO Once done you still must copy over a CD-ROM driver,
ECHO and make sure CONFIG.SYS matches.  Then reboot using
ECHO the floppy and the FreeDOS CD is ready to use as
ECHO though you booted from it!

:END
