@echo off
set cnt=0
for /f "delims=" %%i in ('dir/b/a-d "d:\112" 2^>nul') do (set /a cnt+=1
echo %%i
)
if defined cnt (echo,共有%cnt%个文件.) else echo,没有找到文件.
pause

你可以把"D:\112"修改成你想要的任何文件夹;例如 :for /f "delims=" %%i in ('dir /b /a-d "%cd%\Debug_%timestamp%_*.zip"') do (set /a fCount+=1)
如果希望将”D:\112“下的子文件夹下的文件也包含在内的话,在dir后面再加个/s

 

 

出处:https://zhidao.baidu.com/question/567068676.html

相关文章:

  • 2022-12-23
  • 2021-11-23
  • 2021-10-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-23
相关资源
相似解决方案