ANSWERS: 2
  • 1. in second.bat: call first.bat 2. choose save as 'all files' and use the extension .bat
  • I've used the echo command to create a 2nd bat file from a bat file, but it's tricky. Some complex lines don't get echoed the way you might expect, such as those containing command line parameters %i and %%i. In general, the method is this: Contents of first bat file: echo @echo off > NewBatFile.bat echo echo This is my new batch file. >> NewBatFile.bat echo rem >> NewBatFile.bat echo echo. >> NewBatFile.bat [etc] Note that the first echo creates the new bat file, using a single > . (There are variations on this.) Subsequent echo commands use the double >> to append additional lines to NewBatFile.bat. Look carefully at the last line, above, "echo echo." "Echo." creates a blank line. "Echo echo." puts the "echo." command into the NewBatFile.bat, so when it executes it will echo a blank line to the display.

Copyright 2023, Wired Ivy, LLC

Answerbag | Terms of Service | Privacy Policy