Help to understand

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
ercolino
Posts: 1
Joined: 03 Aug 2022 02:28

Help to understand

#1 Post by ercolino » 03 Aug 2022 02:39

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
Last edited by aGerman on 04 Aug 2022 14:18, edited 1 time in total.
Reason: please use code formatting

aGerman
Expert
Posts: 4654
Joined: 22 Jan 2010 18:01
Location: Germany

Re: Help to understand

#2 Post by aGerman » 04 Aug 2022 14:47

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

Post Reply