我有一个python脚本正在下载一些文件,在执行任务之前,我想知道目录是否为空或者是否小于5的文件数然后运行python否则只是说文件已经存在,如何我可以修改批处理代码以应用此更改。
@echo off
.....
:begin
python.exe "%ScriptFolderPath%"\extractDAILYdata.py -u %UserName% -p %Password% -s %BirstSpace% -r %ATIBaseUrl% -sp %DailyLoadPath% -f "%LogPath%" -i %LogLevel% -l %LogFile%
if %errorlevel%==0 goto bcsuccess
:bcerror
echo Task "%TaskName%" failed: %date% >> "%LogPath%\%LogFile%"
exit /B %errorlevel%
:bcsuccess
echo Task "%TaskName%" succeeded: %date% >> "%LogPath%\%LogFile%"