Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamhow to delete a folder using command prompt
In Windows Command Prompt, use rmdir (or rd) to delete a folder.
Delete an empty folder:
rmdir "C:\path\to\folder"
Delete a folder and everything inside it:
rmdir /s "C:\path\to\folder"
Delete a folder and everything inside it without confirmation:
rmdir /s /q "C:\path\to\folder"
rmdir means remove directory. It works differently depending on whether the folder is empty.
If the folder has no files or subfolders:
rmdir "C:\Users\YourName\Desktop\TestFolder"
If the folder is not empty, add /s:
rmdir /s "C:\Users\YourName\Desktop\TestFolder"
/s = remove all files and subfolders inside itIf you do not want CMD to ask Are you sure (Y/N)?, add /q:
rmdir /s /q "C:\Users\YourName\Desktop\TestFolder"
/q = quiet modeFor modern Windows systems, this is still the standard CMD method.
rmdir and rd are equivalentRemove-Item, but for Command Prompt, rmdir is the correct commandIf the folder name contains spaces, quotes are required:
rmdir /s /q "C:\Users\YourName\Desktop\Old Backup"
Without quotes, CMD may interpret the path incorrectly.
If you are already in the parent folder:
cd C:\Users\YourName\Desktop
rmdir /s /q "Old Backup"
D:
cd \Projects
rmdir /s /q "TestFolder"
rmdir /s /q
because it can erase large directory trees very quickly
If the folder contains important data, verify the path before pressing Enter.
/s /q only when you are certaindir "C:\Users\YourName\Desktop"
rmdir /s "C:\Users\YourName\Desktop\TestFolder"
This lets you confirm the folder exists before deleting it.
1. “Access is denied”
2. “The process cannot access the file because it is being used by another process”
3. “The directory is not empty”
/sIf you want, I can also show you:
Use:
rmdir "path" for an empty folderrmdir /s "path" for a folder with contentsrmdir /s /q "path" to delete everything quietlyExample:
rmdir /s /q "C:\Users\YourName\Desktop\TestFolder"
If you want, send me the exact folder path and I will give you the precise command to paste into CMD.