Page 1 of 1

Help to understand

Posted: 03 Aug 2022 02:39
by ercolino
Hello everyone,
I could use some help to understand what this part of code in a .bat file does:

Code: Select all

for /f "tokens=1 usebackq" %%A in (%casa%\tmp\lista-t.txt) do (
rem del /q /f %casa%\tmp\t-ok.txt
  for /f "tokens=1 usebackq" %%a in (%casa%\tmp\lista-zip.txt) do (call  :CREALISTA-OK %%A %%a )  
  if not exist %casa%\tmp\t-ok.txt echo il file t %%A รจ senza corrispondente zip quindi non lo carico >> %casa%\tmp\t-orfani.txt
                                                               )
if %errorlevel% equ 0 (echo OK >> %log-file%) else (echo FALLITA >> %log-file%)
echo ---------------------------			>> %log-file%

if exist %casa%\tmp\t-orfani.txt (
echo Giorno: %date% Ora: %time% 			>> %log-file%
echo file .t senza zip rilevati: 			>> %log-file%
type %casa%\tmp\t-orfani.txt				>> %log-file%
set testo-mail=Rilevati file .t senza relativo file.zip: vedere file di log o file t-orfani.txt
set termina-script=no
call :ALERT
echo ---------------------------			>> %log-file%
				  ) 
Thanks

Re: Help to understand

Posted: 04 Aug 2022 14:47
by aGerman
It writes a log file. While doing this it may call the subroutines :CREALISTA-OK and :ALERT which are not included in the piece of code that you quoted.

Steffen