Home » IT and Tech Blogs » Information Technology » Troubleshooting » Unable to delete directory

Unable to delete directory

Are you trying to delete a directory, but Windows stubbornly sits there and does nothing?

The Windows DOS command RMDIR removes a directory from your system and has the following syntax:

RMDIR directory_name

For example, to remove directory C:\Directory, enter:

RMDIR C:\Directory

ad banner 619 3 - Unable to delete directory

Note that you cannot be inside the directory that you are deleting; else you will be prompted with the message “The process cannot access the file because it is being used by another process”.

Normally the RMDIR command will not remove a directory if it is empty. However, if you add the /S parameter, all files and directories underneath the specified directory will be removed. USE WITH CAUTION! You will be prompted with an “Are you sure” question that lets you back out in case you entered the wrong directory name.

If you need to perform this task in a batch file, you can add the /Q parameter to the end. This will delete the specified directory, all files, and all subdirectories, WITHOUT ANY WARNING.

For example, the following command will remove directory C:\Directory and all subdirectories and files contained therein. No prompt will be displayed.

RMDIR c:\Directory /s /q

If you wish you can use RD as an abbreviation for RMDIR.

ad banner 619 2 - Unable to delete directory

Republished by Blog Post Promoter

Check Also

itguyuptodate 310x165 - Best IT Blogs - Must Read Information Technology Resources 2018

Best IT Blogs – Must Read Information Technology Resources 2018

This article shares a list of over 50 great must read/must follow Information Technology Blog resources and best sites for IT professionals to stay on top of in the IT industry.

Do NOT follow this link or you will be banned from the site!