You could build a variable (call it %d) that you make by constructing with a set of IF statements:
if exist c:\nul set %%d=c:
if exist d:\nul set %%d=%%d+ d:
if exist e:\nul set %%d=%%d+ e:
if exist f:\nul set %%d=%%d+ f:
Then issue the command:
format %%d /y
in your batch file.
Name the file form.bat to make DOS use it vice the same name as the DOS FORMAT command. To use, type FORM with the floppy in A: and selected as the current drive.