Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Robocopy with spaces won't run

Posted on 2013-06-02
5
Medium Priority
?
661 Views
Last Modified: 2013-06-02
I have a command that I've used for all but one folder to copy data from our old server to the new one.
The main folder name has a space and I have tried with and without inverted commas to no avail.
Any ideas would be greatly appreciated

I have been using the following:

robocopy \\s01-old\folder\2011 folder \\s01-new\folder\2011 folder /E /Z /COPY:DATS /LOG:C:\copylog2011.txt /TEE /R:0 /W:0 /ETA
0
Comment
Question by:CaClo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 25

Expert Comment

by:Tony Giangreco
ID: 39214347
Put double quotes around the full path that contains a space.

robocopy.exe "\\s01-old\folder\2011 folder"  \\s01-new\folder\2011
0
 

Author Comment

by:CaClo
ID: 39214361
I've tried for both the source path and destination path but still get nothing happening.

robocopy "\\s01-old\folder\2011 folder" "\\s01-new\folder\2011 folder" /E /Z /COPY:DATS /LOG:C:\copylog2011.txt /TEE /R:0 /W:0 /ETA

It still seems to 'see' the space :(
0
 
LVL 17

Accepted Solution

by:
Kent Dyer earned 800 total points
ID: 39214369
what you can try to do is to use DOS-16 style of pathing..

Do a DIR /X to get the truncated path and try the ROBOCOPY Command again?

If that does not work..  Try using a SET for the Source and Destination Folders..

SET SRCE = "\\s01-old\folder\2011 folder"
SET DEST = "\\s01-new\folder\2011 folder"

robocopy "%SRCE%" "DEST" /E /Z /COPY:DATS /LOG:C:\copylog2011.txt /TEE /R:0 /W:0 /ETA

If this still does not work..  Try running ROBOCOPY without the switches and just pure ROBOCOPY..

If ROBOCOPY still is not working..  Try just running XCOPY to see if you can run that.

HTH,

Kent
0
 
LVL 25

Assisted Solution

by:Tony Giangreco
Tony Giangreco earned 800 total points
ID: 39214432
If you are running this from the server where this drive exists, change the path to c:\folder\2011 folder  or D:\folder\2011 folder  instead of the path you are using.

If it's a server or workstation in your network, map that location as a drive and run it using the mapped drive letter live p:\folder\2011 folder
0
 

Author Closing Comment

by:CaClo
ID: 39215287
Thanks guys - really got me out of a bind - I went with a combination of setting Source & Destination & using the drive letter and that  has got the data across.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hallo! I guess almost every Windows Administrator must have got stumped with this question "Where does WINDOWS store a users cached credentials? Every user who had once logged onto a Server/Desktop while it was connected to the domain could sti…
Have you ever had a hard drive that you can't boot into, but need to change the registry? Here is the solution! This article guides you through accessing and editing a registry of a non-primary drive. To read registry information on a non-prim…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question