Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to use RoboCopy in my TFS Build Template to copy some files, but for some reason it inserts "C:\Windows\system32" in front of my Source and Destination paths, even though I am passing in absolute paths. I know that the robocopy.exe is stored in "C:\Windows\system32", but how can I make it use my absolute file paths?

Here is the output from my TFS Build Log. This is the command that gets executed:

RoboCopy 'C:\Builds\27\RQ4TeamProject\BuildProcessTests\Binaries' '\\iq-tfsbuild1\buildDrops\BuildProcessTests\0.99.6.32749' /E /XD 'RQ4'

And here is the error reported by robocopy:

-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Thu Jan 24 17:08:47 2013
Source : C:\Windows\system32\'C:\Builds\27\RQ4TeamProject\BuildProcessTests\Binaries'\
Dest : C:\Windows\system32\'\iq-tfsbuild1\buildDrops\BuildProcessTests\0.99.6.32749'\
Files : *.*
○
Exc Dirs : 'RQ4'
○
Options : *.* /S /E /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
2013/01/24 17:08:47 ERROR 123 (0x0000007B) Accessing Source Directory C:\Windows\system32\'C:\Builds\27\RQ4TeamProject\BuildProcessTests\Binaries'\
The filename, directory name, or volume label syntax is incorrect.

Any ideas what is wrong and how I can get it to use JUST the absolute paths I provide? Any suggestions are appreciated. Thanks

share|improve this question
    
I know this may sound silly but have you tried double quotes (") instead of single quotes (') ? –  Diago Jan 25 '13 at 16:38
    
Yup, changing to use double quotes fixed my problem. Strange thing is that I tested it using single quotes from the cmd.exe and from powershell and it worked fine. Oh well, it's working now :) –  deadlydog Jan 25 '13 at 20:00
    
I'd like to know how you added the RoboCopy step to your build template....see my frustration here: stackoverflow.com/questions/22180408/… –  ganders Mar 5 at 21:02
    
Hi @ganders I've submitted an answer on your post. –  deadlydog Mar 6 at 0:26

1 Answer 1

up vote 3 down vote accepted

Use double quotes around the paths if necessary, not single quotes.

share|improve this answer
    
Yeah, changing the command to the following fixed the problem. Thanks! RoboCopy "C:\Builds\27\RQ4TeamProject\BuildProcessTests\Binaries" "\\iq-tfsbuild1\buildDrops\BuildProcessTests\0.99.6.32749" /E /XD "RQ4" –  deadlydog Jan 25 '13 at 19:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.