I have a batch file (BAT1.bat) which returns the following string:
“Login credential: 7o5g4cika”
I need to send a part of the result (ie “7o5g4cika”) as argument to another bat file BAT2.bat.
BAT2.bat 7o5g4cika
How can I combine these to a single bat file?
This line will do what you want:
What this line does is call
BAT1.bat, then parses its output using the options specified after the/F. Specifically,"tokens=3"tells the shell to take the third token and put it in the variable. Then,BAT2.batis called with the variable as its parameter.Assuming you are going to use this in a batch file, you’re going to want to double the percent signs:
For more details, type
from the command line