TFS 2010 Team Build - rename a file
Asked Answered
U

1

6

As part of my TFS 2010 team build, I'm trying to copy a configuration file from a network location to the output folder where the build goes to.

Using xcopy as an invoke process task, I've successfully gotten it all working EXCEPT that I want to rename the file as part of the copy. The problem is that if you supply a different destination filename, XCOPY asks if the destination is a file or a directory e.g.

XCOPY \\networkshare\configs\live.config \\networkshare\release\server.exe.config /R /Y

results in XCOPY asking me to press F if server.exe.config is a file or D if it's a directory. XCOPY doesn't seem to have any way to suppress this behaviour. I've tried using the basic COPY commmand but Team Build just says that it doesn't recognise the COPY command.

Is there any way to easily rename a file as part of Team Build or use another command line tool to achieve this?

Cheers

Ulyanovsk answered 15/4, 2011 at 17:4 Comment(4)
Did you try to do a xcopy first to the same file name and then a ren command to rename the file?Barfly
If I remember correctly, the COPY command is "built in" to the command interpreter, not a separate executable like XCOPY.EXE. The correct incantation would be something like CMD.EXE /C COPYWetzel
that's what i was thinking - wasn't sure how to "call" it then. i will give this a go - thanks!Ulyanovsk
That worked - beauty. Just put cmd.exe as the command and put "/c copy" at the start of the args. Thanks!Ulyanovsk
U
7

Just to confirm - setting the process as CMD.EXE and starting the arguments as "/c copy" does the trick.

Ulyanovsk answered 18/4, 2011 at 9:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.