Copy / Move Folders with Spaces in Path Name with Robocopy

»»»Copy / Move Folders with Spaces in Path Name with Robocopy

Depending on the version of Windows, when using Robocopy (Robust File Copy) to copy or move folders and directories that have spaces in their names, the Robocopy may be skipping the said folders and directories, without copying them to the destination. In other words, Robocopy is not working.

For example,

C:\>robocopy "C:\Tech Journey" "D:\Tech Journey"

   ROBOCOPY     ::     Robust File Copy for Windows                             

  Started : Tuesday, 12 April 2016 1:26:08 PM
   Source : C:\Tech Journey\
     Dest : D:\Tech Journey\

    Files : *.*

  Options : *.* /DCOPY:DA /COPY:DAT /R:1000000 /W:30


                           0    C:\Tech Journey\


               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         0         0         0         0         0         0
   Bytes :         0         0         0         0         0         0
   Times :   0:00:02   0:00:00                       0:00:00   0:00:02
   Ended : Tuesday, 12 April 2016 1:26:11 PM
You must always enclosed path name with spaces in quotation marks (i.e. “”).

You must also provide complete destination path including the folder name, even though you want to copy or move the whole folder to the destination path.

If the command of Robocopy looks correct when dealing with folder name with spaces, but it’s not working, try the following trick: add a space after the path names for source and destination, right before the closing quote.

For example:

C:\>robocopy "C:\Tech Journey " "D:\Tech Journey "

By | 2018-05-06T00:05:23+00:00 May 6th, 2018|Categories: Utilities|Tags: |0 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.