Skip navigation

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

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 
  4. to remove the problematic folder.
Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish