how to create a . bat that creates another . bat with more than one command?

Asked

Viewed 26 times

-3

i want to create a file . bat creating another file . bat, but when I try to create I can’t put more than one command.

example: I have my test.bat file that will create another file called teste2.bat so I used this code:

echo msg * ola > teste2.bat

but if I use it for two commands like:

echo msg * ola start chrome > teste2.bat

it ends up giving error, has some way to make this file perform more than one command?

  • Please clarify your problem or provide additional details in order to highlight exactly what you need. The way it’s written these days it’s hard to tell exactly what you’re asking.

1 answer

0

Just use double ">>" plus sign to add the new commands at the end of the file instead of overwriting the commands that already exist in the new bat...

echo msg * ola >> teste2.bat
echo start chrome >> teste2.bat

Browser other questions tagged

You are not signed in. Login or sign up in order to post.