I forgot the /F in the batch file ..... :(
-----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Newton Sent: 08 July 2014 10:28 To: [email protected] Subject: RE: [NF] Need a batch file to process all the files listed in a text file Paul I tried this in a batch file For %%a In (TEST.TXT) Do Echo %%a And what was echoed to the screen was one line containing "TEST.TXT " (without the quotes. The lines of text in TEST.TXT were not displayed at all However, at the command prompt the following did work properly for /f %a in (test.txt) do echo %a Any ideas? Paul (snap) -----Original Message----- From: ProfoxTech [mailto:[email protected]] On Behalf Of Paul Hill Sent: 08 July 2014 09:41 To: [email protected] Subject: Re: [NF] Need a batch file to process all the files listed in a text file On 8 July 2014 09:19, Paul Newton <[email protected]> wrote: > Hi all > > I have a requirement for a batch file which will execute a single command for > every file listed in a text file. The text file will contain one > fully-qualified filename on each line. I am sure there must be a way but I > am afraid that my DOS/BAT knowledge is very rusty indeed. Hi Paul, The 'for' command can do this: for /f %a in (test.txt) do echo %a Replace 'echo' with your command If you are using this in a batch file substitute %a with %%a. -- Paul [excessive quoting removed by server] _______________________________________________ Post Messages to: [email protected] Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech Searchable Archive: http://leafe.com/archives/search/profox This message: http://leafe.com/archives/byMID/profox/[email protected] ** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.

