Nested For /F in batch reading input from txt
Posted: 07 Apr 2011 02:11
hello. 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
Note: this part - "C:\Program Files (x86)\iOpus\iMacros\iMacros.exe" -macro "screenshot.iim" -var_offercode %%G
will be executed within the next 4 hours before going to 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.
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
Note: this part - "C:\Program Files (x86)\iOpus\iMacros\iMacros.exe" -macro "screenshot.iim" -var_offercode %%G
will be executed within the next 4 hours before going to 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.