Dos

Asked • 07/09/19

Anything after DOS FOR /F loop not executing?

I've had a jolly good search through the world of google to find a similar problem to mine, but I can't find any examples of people doing things outside of their FOR /F loops and so I am resigned to creating a new thread.I am using a FOR /F loop to execute a Ruby Gem once per line it finds in a reference file, which it does perfectly. The problem is, when it has finished scrolling through its reference file and executed the Ruby Gem the correct amount of times, it will not complete anything else in the .CMD file outside of the FOR /F loop.Here is my .CMD code: FOR /F "tokens=1,2,3 delims=," %%a in (c:\\cygwin\\usr\\work\\easy.lst) do ( c:\\ruby191\\bin\\scrapitalist website -u http://www.website.com/%%a/%%c/%%b.html -o C:\\cygwin\\usr\\autobets\\work\\%%b_%%c.easy ) copy c:\\cygwin\\usr\\work\\*.easy c:\\cygwin\\usr\\autobets\\work\\easy.impThe easy.lst file has two lines of data in it.The loop works fine, executing the Ruby Gem and creating *.easy files as output, however, the COPY command never executes. I can replace the copy with an ECHO, or in fact anything, but it will not execute.I cannot see what I am missing from my FOR /F syntax - any ideas peeps?Thanks

1 Expert Answer

By:

Rize S. answered • 03/23/23

Tutor
New to Wyzant

Senior IT Certified Trainer, IT Developer & DBA Administrator

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.