How to write Windows batch files

You can put MzScheme code in a Windows batch file, that is, a file with a .BAT extension. Batch files can be executed directly from the command line. In Windows 95 and 98, the batch file looks like:
 ; @echo off
 ; d:\plt\mzscheme -r %0 %1 %2 %3 %4 %5 %6 %7 %8 %9
 ; goto :end
  ... scheme-program ...
 ; :end
With this code, your batch file can use as many as nine parameters. In Windows NT and Windows 2000, you can instead write
 ; @echo off
 ; d:\plt\mzscheme -r %0 %*
 ; goto :end
  ... scheme-program ...
 ; :end
This code allows an arbitrary number of parameters to your batch file.

The batch file code works by combining both batch and MzScheme syntax in a single file. This is the same idea used in MzScheme UNIX shell scripts. When invoked from the command line, the semicolons are ignored. The second line invokes MzScheme with the batch file as an argument. MzScheme interprets the lines beginning with semicolons as comments, and runs the Scheme code. When the Scheme program is done, control returns to the batch file, and the goto jumps around the Scheme code.