1、判断文件是否存在,存在就删除
cd D:\workproj\
set "file_path=1.txt"
if exist %file_path% (
echo File exist and delete
del /f "%file_path%"
echo finish delete
)
del命令:/f表示强制删除
1、判断文件是否存在,存在就删除
cd D:\workproj\
set "file_path=1.txt"
if exist %file_path% (
echo File exist and delete
del /f "%file_path%"
echo finish delete
)
del命令:/f表示强制删除