Ciao a tutti ho fatto questo script ma non capisco perchè mi riporti dati sbagliati sui campi fornass,finenol e documento mi mette il campo CODICE (%%a).
Questo script legge i valori da un file csv riga per riga e crea le chiavi di registro corrispondenti. Chi mi sa dire qualcosa?

@echo off
CD /D %0\..
FINDSTR /I "%COMPUTERNAME%" result.csv && goto next
goto end

:next
FINDSTR /I "%COMPUTERNAME%" result.csv>mydata.csv
for /f "tokens=1-12 delims=," %%a in (mydata.csv) do call :work %%b %%c %%d %%e %%f %%g %%h %%i %%j %%k %%l
goto end


:work
SET CODICE=%1
SET FORNITORE=%2
SET DATAACQ=%3
SET UNITA=%4
SET AREA=%5
SET OEM=%6
SET NOLEGGIO=%7
SET FINEGAR=%8
SET FINENOL=%9
SET FORNASS="%10"
SET DOCUMENTO="%11"

reg add "HKLM\Software\Asset" /v CODICE /t REG_SZ /d "%CODICE%" /f
reg add HKLM\Software\Asset /v FORNITORE /t REG_SZ /d %FORNITORE% /f
reg add HKLM\Software\Asset /v DATAACQ /t REG_SZ /d %DATAACQ% /f
reg add HKLM\Software\Asset /v AREA /t REG_SZ /d %AREA% /f
reg add HKLM\Software\Asset /v UNITA /t REG_SZ /d %UNITA% /f
reg add HKLM\Software\Asset /v OEM /t REG_SZ /d %OEM% /f
reg add HKLM\Software\Asset /v NOLEGGIO /t REG_SZ /d %NOLEGGIO% /f
reg add HKLM\Software\Asset /v FINEGAR /t REG_SZ /d %FINEGAR% /f
reg add HKLM\Software\Asset /v FINENOL /t REG_SZ /d %FINENOL% /f
reg add HKLM\Software\Asset /v FORNASS /t REG_SZ /d %FORNASS% /f
reg add HKLM\Software\Asset /v DOCUMENTO /t REG_SZ /d %DOCUMENTO% /f

:end
pause