这段代码无法运行:
@echo off
if exist output @set /p checkdir= Output directory found. Do you wish to overwrite it?:
if /I %checkdir% == Y deltree /s /output
pause
这段代码无法运行:
@echo off
if exist output @set /p checkdir= Output directory found. Do you wish to overwrite it?:
if /I %checkdir% == Y deltree /s /output
pause
RMDIR [/S] [/Q] [drive:]path
RD [/S] [/Q] [drive:]path
/S Removes all directories and files in the specified directory
in addition to the directory itself. Used to remove a directory
tree.
/Q Quiet mode, do not ask if ok to remove a directory tree with /S
在您的情况下,只需使用/S即可,它将首先询问用户是否应该继续,然后删除整个目录树,即在屏幕上显示以下输出:"folderName, Are you sure (Y/N)?"
folderName
是您希望删除的文件夹(及其子文件夹)的名称。