I have a batch file that i am testing, all i want to do is the following
CALL ping.bat
Then after that batch file has run i want to run another file:
CALL ping2.bat
Right now i have these two lines beside each other in a batch file the first batch file will fire successfully but the second one does not . Any suggestions?
CALL ping.bat CALL ping2.bat
Ping .bat is just:
ping 127.0.0.1
Used within a batch file to specify the name of another batch file (a file with the . BAT filename extension). The original batch file calls into action the CALLed batch file. When the CALLed batch file ends, control is transferred back to the original batch file.
Use double percent signs ( %% ) to carry out the for command within a batch file. Variables are case sensitive, and they must be represented with an alphabetical value such as %a, %b, or %c. Required. Specifies one or more files, directories, or text strings, or a range of values on which to run the command.
%%parameter : A replaceable parameter: in a batch file use %%G (on the command line %G) FOR /F processing of a command consists of reading the output from the command one line at a time and then breaking the line up into individual items of data or 'tokens'.
When used in a command line, script, or batch file, %1 is used to represent a variable or matched string. For example, in a Microsoft batch file, %1 can print what is entered after the batch file name.
Check that you don't have exit
somewhere in the first batch. Some people habitually use that to jump out of a batch file which is not the proper way to exit a batch (exit /b
or goto :eof
is).
Another option is that you might call another batch in the first one without call
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With