@echo off
for /f “delims=:” %%a in (‘dir /b "./.docx" ^| findstr /n .’) do set count=%%a
echo %count%
set /a count +=1
::加一
echo %count%
if (%count% equ 4) (
echo 123456
)else (
echo 7891011
)
pause
bat脚本查看目录下文件数量
@echo off
for /f “delims=:” %%a in (‘dir /b "./.docx" ^| findstr /n .’) do set count=%%a
echo %count%
set /a count +=1
::加一
echo %count%
if (%count% equ 4) (
echo 123456
)else (
echo 7891011
)
pause
bat脚本查看目录下文件数量