Hi everybody!
I have a batch file (MS-DOS) containing inside multiple FOR LOOPS with variables %%a or equivalent and strings like this:
for /F "usebackq tokens=1,2 delims=,:" %%X ^
in (`%IM%convert convert RPS.bmp txt:^|find "%colorRPS%"`) ^
do (
set /A sigXRPS+=%%X
set /A sigYRPS+=%%Y
set /A nCountRPS+=1
)
I need to process, in the same way, a set of images, all named for example "test1.bmp", "test2.bmp", "test3.bmp"... etc etc... say like 30 pictures.
I tried to put a big FOR %%a IN (test*.bmp) DO (...) and put inside all my batch code, but I can't find a way of making it work...
inside the batch code there are some variables that are defined along the way and echoed later, as well as names of output files (both images and text files) that are created and then erased or combined.
Why is my FOR LOOP not working?
Any suggestions?
thanks!
Cannot use a FOR LOOP on a batch file
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Cannot use a FOR LOOP on a batch file
Difficult to say without seeing it. If you set a variable within a loop then references need !this! instead of %this%, and you need enabledelayedexpansion. Commands inside loops that contain parentheses needs to have them escaped or quoted.troller wrote:Why is my FOR LOOP not working?
snibgo's IM pages: im.snibgo.com