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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
georgehanna1993
Posts: 1
Joined: 25 Aug 2020 07:35

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

#1 Post by georgehanna1993 » 25 Aug 2020 07:37

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!

penpen
Expert
Posts: 2009
Joined: 23 Jun 2013 06:15
Location: Germany

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

#2 Post by penpen » 25 Aug 2020 10:17

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

Post Reply