I have this code in .bat file
FOR /F "tokens=* delims= " %%G in (partners.txt) DO "C:\Program Files (x86)\iOpus\iMacros\iMacros.exe" -macro "screenshot.iim" -var_offercode %%G
ANOTHER COMMAND
How can I instruct the batch file to do the ANOTHER COMMAND first before getting the next input for variable %GG from partners.txt. basically, I need to complete the first cycle first before going on the next line. Currently, it finishes the list in partners.txt before moving to ANOTHER COMMAND.
Thanks a lot!
Put a statement list in parentheses:
for /f %%x in (partners.txt) do (
statement 1
statement 2
)
One thing to note before you ask one of the most frequent questions as a follow-up one: Environment variables are expanded for the whole block as soon as the line is parsed which means if you set environment variables somewhere in that block the changes will not be visible until you step out of the loop. See help set for a discussion of the problem and a solution. If you need to go that route, that is.
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