2011-10-24 5 views
31

動作しません。このコード:現在のディレクトリからフォルダとそのすべてのコンテンツを削除するにはどうすればよいですか?

@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 
+1

どのような問題が見つかりましたか? DELTREEは現在のWindowsの多くのバージョンには存在しません。ルートは現在のディレクトリですか? –

答えて

73

をあなたは、このコマンドを探していました:あなたのケースで

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 それはディレクトリツリー全体を削除しても聞いてきます最初に進むべきユーザ

関連する問題