Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamhow to delete directory in command prompt
In Windows Command Prompt, use rmdir or rd to delete a directory.
Delete an empty directory:
rmdir "FolderName"
Delete a directory with all files and subfolders:
rmdir /s "FolderName"
Delete it without confirmation prompt:
rmdir /s /q "FolderName"
rmdir /s /q "C:\Users\YourName\Desktop\TestFolder"
The correct command in Windows CMD is:
rmdir
or its shorter alias:
rd
Both do the same thing.
rmdir is enough./s.Examples:
rmdir "MyEmptyFolder"
rmdir /s "MyFolder"
If you do not want CMD to ask:
Are you sure (Y/N)?
use /q together with /s:
rmdir /s /q "MyFolder"
This is commonly used in batch scripts and automation.
If the path contains spaces, use double quotes:
rmdir /s "C:\My Files\Old Folder"
You cannot delete the folder you are currently inside.
Move out first:
cd ..
rmdir /s "FolderName"
Files deleted this way are typically not sent to the Recycle Bin. Treat it as permanent deletion.
If you get Access is denied, open Command Prompt as Administrator.
Do not use del to remove a folder itself.
del deletes filesrmdir deletes directoriesIf you want to be cautious, run:
rmdir /s "FolderName"
This gives a confirmation prompt.
If you are completely sure and want automation:
rmdir /s /q "FolderName"
/q unless you are certainTo delete a directory in Windows Command Prompt:
Empty folder:
rmdir "FolderName"
Folder with contents:
rmdir /s "FolderName"
No confirmation prompt:
rmdir /s /q "FolderName"
If you want, I can also show: