|hello. I am also very much beginner Xp batch. I ran some tests, and i could not get any variation of "tokens=" other|
than value 1 to work. However, i have seen Judago's posts and I know he is experienced. something we're both doing wrong.
my tests resulted with anything other than 1 supplied for "tokens =" failed. I tried it a bunch of variations and the script went into suspended animation. I, too, will risk looking stupid/ridiculous, but that was my experience.
in the meantime, maybe try changeing:
FOR /F "tokens=2,3 delims=_" %%A IN ('%FILENAME%\*.tga') DO IF "%%B"=="[%1]" SET IMGTYPE=%%A
for /f "tokens=1,3 delims= " %%A in ('%filename%\*.tga') do (
if %%C=="[%1]" set imgtype=%%C
the var. names are assigned from the %% specification (a,b,
etc) upwards for each token. the %% spec can be any single-letter alpha name (a-z, A-Z) and each token assigned to the var beginning with the first spec (%%a etc) till end of inputline.
to me, it *should* work as you have written: specif tokens=
2,3 would skip over token (field) one, assigning field 2 to the %% specification var.name and moving up from there. Why don' it work that way?? i'm missing something...
If it's stupid question, I'm in same boat cause i don' kno ether.