Robocopy prepends drive letter on filepaths even when drive is specified

1

robocopy /"C:\Users\john smith\Documents\Visual Studio 2010\Projects\project\checker\bin\Debug\/" /"C:\Users\john smith\project\Assemblies/" checker.dll

When I run this through the command line it adds an extra C:\ before the filepaths (e.g. C:\Users\john smith\Documents\Visual Studio 2010\Projects\project\checker\bin\Debug\ becomes C:\C:\Users\john smith\Documents\Visual Studio 2010\Projects\project\checker\bin\Debug\).

Why?

MHTri

Posted 2012-10-03T14:26:11.967

Reputation: 131

looks like / is interpreted as drive root (c:\\). Those forward slashes seem out of place, what's their intended purpose btw? – wmz – 2012-10-03T14:56:29.957

It's supposed to escape the quote marks I had to include since my filepaths have spaces. – MHTri – 2012-10-03T15:52:22.170

Answers

2

The forward slashes were unnecessary - they were indeed screwing up robocopy's path interpreter. However, when building with Visual Studio's macros you have to add an extra trailing backslash to escape the included backslash of a path, otherwise it will escape the quote mark.

So the working command is: robocopy "C:\Users\john smith\Documents\Visual Studio 2010\Projects\project\checker\bin\Debug\" "C:\Users\john smith\project\Assemblies" checker.dll

MHTri

Posted 2012-10-03T14:26:11.967

Reputation: 131