echo off chcp 1251 Title Сканирование каталогов set MasterFolder Новоч

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
@echo off
chcp 1251
Title Сканирование каталогов
set MasterFolder=R:\Новочебоксарск
Set LogFile=1042_50_Проверка.txt
If exist "%LogFile%" Del "%LogFile%"
echo Сканирование каталогов и создание массива...
SetLocal EnableDelayedexpansion
@FOR /f "delims=" %%f IN ('dir /b /s "%MasterFolder%\1042_50_*.rvt"') DO (
set /a "idx+=1"
set "FileName[!idx!]=%%~nxf"
set "FilePath[!idx!]=%%~dpf"
set "FileSize[!idx!]=%%~zf"
set "FileDate[!idx!]=%%~tf"
)
for /L %%i in (1,1,%idx%) do (
echo [%%i] "!FileName[%%i]!"
(
echo(!FilePath[%%i]! !FileName[%%i]! !FileSize[%%i]! !FileDate[%%i]!)>> "%LogFile%"
)
ECHO(
ECHO Total text files(s) : !idx!
TimeOut /T 5 /nobreak>nul
Start "" "%LogFile%"