Windows 11 フォルダ削除 コマンドプロンプト

Pocket

Windows 10 11 の コマンドプロンプトで フォルダを削除する場合は、 RMDIR もしくは RD というコマンドを使います

rmdir コマンド 例

c: のルートに test1というフォルダがあり その中の test2 フォルダを削除したい場合

下記のコマンドでフォルダを削除できます

cd ¥test1
rmdir /s test2

「/s」で フォルダ内にデータがあっても フォルダ削除できます

rm コマンドも 方法は同じです

rd /s /q フォルダ名

コマンド内に 「/q」を含めると 「、 よろしいですか?」の質問が 表示されることなく フォルダ削除できます。

PowerShell で フォルダ削除 する場合

PowerShell の場合 Remove-Item コマンドを使います

Remove-Item -Force .\フォルダ名

「-Force」を 含めると サブフォルダなどの含めて フォルダ/ファイルを 削除できます

「-Force」がないと 「The item at フォルダ名 has children and the Recurse parameter was not specified. If you continue, all children
will be removed with the item. Are you sure you want to continue?」と 表示されます

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です

CAPTCHA


2022 MJELD TECHNOLOGIES. ALL RIGHTS RESERVED