Utilisation de Call SET pour désigner une variable dans une boucle Dos Batch "For"


Essayer d'utiliser l'appel DÉFINI pour définir une variable dans une boucle de fichier batch Windows. Ne fonctionne pas mais voici le fichier d'entrée / sortie. essayer d'assigner Var C à égal à 1.

Fichier batch:

 @ECHO OFF
for /f "tokens=1-3 delims=," %%a in (Puck.csv) do (

echo Hello No Hockey>%%a.txt

echo #:A %%a>>%%a.txt

echo #:B %%b>>%%a.txt

if /I %%c gtr 10 call set %%c==1

echo #:C %%c>>%%a.txt

)

Puck.csv

1991,NHL Strike,20

1992,NHL Strike,20

1993,NHL Strike,20

Sortie:

Hello No Hockey
#:A 1991
#:B NHL Strike
#:C 20
Hello No Hockey
#:A 1992
#:B NHL Strike
#:C 20
Hello No Hockey
#:A 1993
#:B NHL Strike
#:C 20

demandé sur