@echo off

set EXE=AUTOCORR-NetIII.EXE 

del /F bad.bad                                 2>nul
del /F report.txt                              2>nul
set DR=%CD%
if %DR%_ == _ goto lerr2
echo =========================== >>report.txt 

del /F %DR%\ZAK\tab_out.txt %DR%\ZA2\tab_out.txt %DR%\ZA3\tab_out.txt %DR%\ZA4\tab_out.txt %DR%\DI1\tab_out.txt %DR%\DIV\tab_out.txt %DR%\ZAK2\tab_out.txt %DR%\ZAK3\tab_out.txt %DR%\DIV3\tab_out.txt %DR%\INKZ\tab_out.txt %DR%\INKU\tab_out.txt %DR%\INKK\tab_out.txt %DR%\INKZ2\tab_out.txt %DR%\INKL\tab_out.txt %DR%\INCL_UDL\tab_out.txt %DR%\INCL2_UDL\tab_out.txt %DR%\INCL3_UDL\tab_out.txt %DR%\INCL4_UDL\tab_out.txt %DR%\ASC\tab_out.txt %DR%\ASN\tab_out.txt %DR%\INK\tab_out.txt %DR%\tbt\tab_out.txt  %DR%\rgi\tab_out.txt  %DR%\tkb\tab_out.txt  2>nul
del /F %DR%\FZAK\tab_out.txt %DR%\FZA2\tab_out.txt %DR%\FZA3\tab_out.txt %DR%\FZA4\tab_out.txt %DR%\FDI1\tab_out.txt %DR%\FDIV\tab_out.txt %DR%\FZAK2\tab_out.txt %DR%\FZAK3\tab_out.txt %DR%\FDIV3\tab_out.txt %DR%\FINKZ\tab_out.txt %DR%\FINKU\tab_out.txt %DR%\FINKK\tab_out.txt %DR%\FINKZ2\tab_out.txt %DR%\FINKL\tab_out.txt %DR%\FINCL_UDL\tab_out.txt %DR%\FINCL2_UDL\tab_out.txt %DR%\FINCL3_UDL\tab_out.txt %DR%\FINCL4_UDL\tab_out.txt %DR%\FASC\tab_out.txt %DR%\FASN\tab_out.txt %DR%\FINK\tab_out.txt %DR%\Ftbt\tab_out.txt  %DR%\Frgi\tab_out.txt  %DR%\Ftkb\tab_out.txt  2>nul

call one_test.bat ASC %EXE% %DR%
call one_test.bat ZAK %EXE% %DR% 
call one_test.bat RGI %EXE% %DR% 
call one_test.bat TBT %EXE% %DR% 
call one_test.bat ZA2 %EXE% %DR% 
call one_test.bat ZA3 %EXE% %DR% 
call one_test.bat ZA4 %EXE% %DR% 
call one_test.bat DI1 %EXE% %DR% 
call one_test.bat DIV %EXE% %DR% 
call one_test.bat ZAK2 %EXE% %DR% 
call one_test.bat ZAK3 %EXE% %DR% 
call one_test.bat INKK %EXE% %DR% 
call one_test.bat INKU %EXE% %DR% 
call one_test.bat DIV3 %EXE% %DR% 
call one_test.bat INKZ %EXE% %DR% 
call one_test.bat INKZ2 %EXE% %DR% 
call one_test.bat INKL %EXE% %DR% 
call one_test.bat INCL_UDL %EXE% %DR%  
call one_test.bat INCL2_UDL %EXE% %DR%  
call one_test.bat INCL3_UDL %EXE% %DR% 
call one_test.bat INCL4_UDL %EXE% %DR% 
call one_test.bat ASN %EXE% %DR% 
call one_test.bat INK %EXE% %DR% 
call one_test.bat TKB %EXE% %DR% 

call one_test.bat FASC %EXE% %DR%
call one_test.bat FZAK %EXE% %DR% 
call one_test.bat FRGI %EXE% %DR% 
call one_test.bat FTBT %EXE% %DR% 
call one_test.bat FZA2 %EXE% %DR% 
call one_test.bat FZA3 %EXE% %DR% 
call one_test.bat FZA4 %EXE% %DR% 
call one_test.bat FDI1 %EXE% %DR% 
call one_test.bat FDIV %EXE% %DR% 
call one_test.bat FZAK2 %EXE% %DR% 
call one_test.bat FZAK3 %EXE% %DR% 
call one_test.bat FINKK %EXE% %DR% 
call one_test.bat FINKU %EXE% %DR% 
call one_test.bat FDIV3 %EXE% %DR% 
call one_test.bat FINKZ %EXE% %DR% 
call one_test.bat FINKZ2 %EXE% %DR% 
call one_test.bat FINKL %EXE% %DR% 
call one_test.bat FINCL_UDL %EXE% %DR%  
call one_test.bat FINCL2_UDL %EXE% %DR%  
call one_test.bat FINCL3_UDL %EXE% %DR% 
call one_test.bat FINCL4_UDL %EXE% %DR% 
call one_test.bat FASN %EXE% %DR% 
call one_test.bat FINK %EXE% %DR% 
call one_test.bat FTKB %EXE% %DR% 

cd test-las
echo check equal wells >con
..\%EXE%.exe /w %DR%\test-las\TestLas.lst %DR%\test-las\tab_out.txt %DR%\zak.lck
cd ..

:l1

set PAR=0.2 -r10

CompareTabs.exe %DR%\tab_out.txt  %DR%\ASC\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZAK\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\RGI\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\TBT\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZA2\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZA3\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZA4\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\DI1\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\DIV\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZAK2\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ZAK3\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INKK\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INKU\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\DIV3\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INKZ\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INKZ2\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INKL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INCL_UDL\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INCL2_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INCL3_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INCL4_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\ASN\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\INK\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\TKB\tab_out.txt  %PAR%

CompareTabs.exe %DR%\tab_out.txt  %DR%\FASC\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZAK\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FRGI\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FTBT\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZA2\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZA3\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZA4\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FDI1\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FDIV\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZAK2\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FZAK3\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINKK\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINKU\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FDIV3\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINKZ\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINKZ2\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINKL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINCL_UDL\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINCL2_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINCL3_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINCL4_UDL\tab_out.txt %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FASN\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FINK\tab_out.txt  %PAR%
CompareTabs.exe %DR%\tab_out.txt  %DR%\FTKB\tab_out.txt  %PAR%

:l2

if not exist %DR%\test-las\tab_out.txt goto l22
echo Following wells differ from the first well: >>report.txt
type %DR%\test-las\tab_out.txt >>report.txt
type %DR%\test-las\tab_out.txt >>bad.bad
echo =========================== >>report.txt 

:l22

if exist bad.bad goto le
echo All is OK
echo All is OK >>report.txt 
notepad report.txt 
exit
:le

echo Some errors found. Check your program!!!!!!!!!
echo In subfolder Plugins you can find last versions of program DLL.
echo Try to copy DLL from folder Plugins into program subfolder ...\wlas\Plugins\

echo Some errors found. Check your program!!!!!!!!! >>report.txt 
echo In subfolder Plugins you can find last versions of program DLL. >>report.txt 
echo Try to copy DLL from folder Plugins into program subfolder ...\wlas\Plugins\  >>report.txt 

notepad report.txt 
exit
:lerr2
echo This is not Shell of Windows2000 or WindowsXP
echo Sorry...