@echo on
set CHECKDIR=%~dp0
title Collecting datas on %COMPUTERNAME% Please wait...
for /F "tokens=1,2*" %%i in ('reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Desktop 2^>NUL ^| findstr REG_SZ') do set ESI_LOGDIR=%%k
if "%ESI_LOGDIR%" EQU "" set ESI_LOGDIR=%USERPROFILE%
set ESIDATE=%DATE:/=-%
set ESIDATE=%ESIDATE: =-%
set LOGFILE=%ESI_LOGDIR%\check_%COMPUTERNAME%_%ESIDATE%.txt
if EXIST "%LOGFILE%" del /Q "%LOGFILE%"
start "Tail output file" "%CHECKDIR%ESICheckTools\Wintail.exe" "%LOGFILE%"
for %%t in ("%CHECKDIR%ESICheckTools\*.bat") do echo %%~nt...& call "%%~t" >> "%LOGFILE%"
echo. >> "%LOGFILE%"
echo All this output is available on your desktop in file: >> "%LOGFILE%"
echo %LOGFILE% >> "%LOGFILE%"
echo. >> "%LOGFILE%"