-3

So, on school we need to make this assignment. So we tried to make a bat file that make's some folders and dox. but the problem is: we want to let the bat file make another bat file.(with commands in it) but if we write it like: echo. @echo off F: tree/f>menu.bat this creates a .bat file that doesn't work. probebly cause we didnt add lines. so how to do this? how do we fix this?

looking forward to it.

1 Answers1

0

You can use the >> operator to add lines to existing files. One > by itself will create a new file (or overwrite the contents of an existing file).

echo @echo off >menu.bat
echo F: >>menu.bat
echo tree /f >>menu.bat
SomethingDark
  • 13,229
  • 5
  • 50
  • 55