Page 1 of 1

Batch file opens another batch file - pushing commands into the second file

Posted: 25 Aug 2020 07:37
by georgehanna1993
Hey guys,
I have a batch file which opens another batch file,
after opening the second batch file, I need to enter commands in the second one.
what is the right way to do it?

Thanks in advance!

Re: Batch file opens another batch file - pushing commands into the second file

Posted: 25 Aug 2020 10:17
by penpen
The answer heavily relies on what you might mean with the term "open", some possibilities:
- you called your second batch file, so it actually runs and you want it to change itself while running,
- you have used a for/f-loop using the findstr on your second batch file which length is <= 8192 bytes long,
- you have used a for/f-loop using the findstr on your second batch file which length is > 8192 bytes long,
- you accessed the source of your second batch file with redirection, a for/l-loop and the set/p-command,
- ... .


penpen