views:

1873

answers:

4

I'm using Team Foundation Server 2008 (SP 1) and I need to move multiple files from one folder to another (to retain file history). In addition to Team Explorer (with SP 1) I've also got the latest TFS Power Tools (October 2008) installed (for Windows Shell integration).

Now, the problem is that I can't seem to select and move multiple files via either the shell or the Source Control Explorer window. I can move individual files (by right clicking + "Move") and I can move whole folders (same operation) but when I select multiple files (in a folder) the "Move" context item is grayed/disabled.

Does anyone know if this is possible.. and if not.. why not!?

Can anyone suggest a workaround which isn't overly complicated?

+9  A: 

Use the tf.exe tool from the Visual studio commandline - it can handle wildcards:

tf.exe move <olditem> <newitem>

Example:

tf.exe move $/MyProject/V* $/MyProject/Archive
Kurt Schelfthout
Thanks, I'll give this a try!
RobS
It worked for me.
mqbt
worked for me.. I'll have to check if it moves the history as well
RobS
A: 

You can move them in Visual Studio solution explorer.

Tomas Kirda
Yeah the problem there is that it's like a cut and paste - you lose the file history as it tells TFS to "add" and "delete" the files rather than moving them
RobS
A: 

Stick all the files that you wish to move, under a folder and then move that folder.

Merrick Chaffer
A: 

Probably a little late here, but I've just discovered that you can indeed move folders in TFS ( do it in Source Control Explorer - right click the folder, move )...

HOWEVER, and this is a huge fail on TFS behalf, it does not move the history! So by moving a bunch of files from one location to another, you'll lose the ability to roll back to a previous version. I just learned this the hard way.

If anybody knows a way around this, i'd love to know about it. And no, "Use SVN/GIT/etc" is not a workaround (as much as i'd love to, its just not an option here).

Here's a link with this problem spelled out: http://budurl.com/3ah5

UGH!

Gregorius