wlf2r 当前离线
上等兵
for /f "usebackq" %%a in ('D:\a\a.txta') do set size2= %%~za if %size1% equ 0 ( echo. size:0 )复制代码
if %size1% == "" ( echo. size:0 )复制代码
aloha20200628 当前离线
上尉
@echo off &for %%a in ("D:\a\a.txta") do if exist "%%~a" (echo,filesize=%%~za) else echo,filesize=0复制代码
TOP
ShowCode 当前离线
VIP1
@echo off set "TestFile=C:\Test\1.txt" set "FileSize=0" if exist "%TestFile%" ( for %%a in ("%TestFile%") do ( if not %%~za == 0 ( set "FileSize=%%~za" ) ) ) echo Size:%FileSize% pause复制代码