Why does FOR / F "skip = 0" fail?

In the standard Windows batch file (.cmd) I want:

FOR /F "skip=0" %%G IN (filename.txt) DO ( ECHO %%G )

but i get " was unexpected at this time.

"skip=1"works fine ( 0there is a variable in my actual code ).

According to ss64.com , the default value skip=0, but it does not seem to work with an explicit set.

Am I doing it wrong? Or is there a workaround that I can use?

Edit:

I tried this on both Windows Server 2003 and Windows 7.

The contents of filename.txt may be:

something
stuff
unicorns
+5
source share
2 answers

0, ( 09, , ).

, , skip=n , . -

if %N% GTR 0 (
  set SKIP="skip=%N%"
) else (
  set SKIP=
)

for /f %SKIP% %%G ...

( , ).

+6

"" , IF "" :

::   liste des fichiers du repertoire et de ses sous-repertoires
echo ***   liste des fichiers du repertoire et de ses sous-repertoires >%FicListImg%
dir /s /b /a:-d %RepImg%\*.*  >> %FicListImg%
set compteurA=0
for /f %%a in (%FicListImg%) do set /a CompteurA+=1  
set /a CompteurA = %CompteurA%-1
set /a NbImg = %CompteurA%-1
@echo Repertoire Images : %RepImg%  (%NbImg% images) 
0

All Articles