How can I delete a folder whose name contains a drive letter?

John Savill

April 6, 2003

1 Min Read
ITPro Today logo in a gray background | ITPro Today

A. A reader recently contacted me regarding a problem that occurred when he misformed a Robocopy command and accidentally created a folder named "Y:DESTINATION /" with a subdirectory of "MIR". The misformed command was

robocopy "X:SOURCEDIR" "Y:DESTINATION /MIR /SEC

Notice that a double-quote is missing at the end of the command.

When the user viewed the folder using Windows Explorer, the folder simply appeared with the name "DESTINATION" instead of the folder's true name. To delete the folder, perform the following steps:

  1. Start a command session by going to Start, Run and typing

    cmd
  2. Navigate to the location where the folder exists.

  3. Run the command

    rmdir "Y:DESTINATION /" /s 

    to remove the problematic folder.

About the Author

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like