echo off

cd /d "%~dp0"

for /F "tokens=*" %%A in (av_banned_configs.txt) do (
	if exist "..\AlertViewer\alertviewer_api\data\2_3types_of_lists\info4c\%%A.json" (
		echo "%%A.json exists"
		goto :failed
	)
)


echo ----------------------------------
call :EchoColor "check_av_banned_configs.cmd: ok" Green
                                     
exit /b 0

:failed
cd /d %~dp0
call :EchoColor "check_av_banned_configs.cmd: failed" Red

exit /b 1

:EchoColor [text] [color]
powershell "'%~1'.GetEnumerator()|%%{Write-Host $_ -NoNewline -ForegroundColor %~2}"
exit /B

:CheckErrorLevel [errlevel] [emessage] 
echo ELEVEL:%~1
rem if %~1 NEQ 0 goto :failed
if %~1 EQU  0 exit /b
call :EchoColor "%~2" Red
echo .
exit /b 1
