Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loop in batch file

Status
Not open for further replies.

johnhugh

Technical User
Mar 24, 2010
702
SG
Hello,

Sorry for writing my post here but I couldn't find a forum for batch files.

I'm trying to have my batch file execute a command within my loop but cannot get to do it.

The code will display all countries in my txt file but only run the command for the last country.
How can I make the command run for all countries?
Any advice much appreciated.

Code:
REM Loop for countries
for /f %%a in (countries.txt) do (
echo %%a
set country=%%a

"c:\Program Files (x86)\PDF\PDFMerge\Pdfmerge" Daily_POs_countries.xml c:\Scheduled_Reports\Countries\%country%\Daily_PO_Reports_%country%.pdf
)



 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top