This code that does not work:
@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
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You were looking for this command:
In your case just use /S
,it will delete the whole directory tree by first asking the user if it should proceed, i.e.- displaying the following output to the screen:
"folderName, Are you sure (Y/N)?"where
folderNameis the name of the folder (and its sub-folders) you wish to remove.Tested on Windows 7, 64 bit.