Solved

Microsoft, Team Foundation Source Control, Command Line get command

Posted on 2007-11-14
2
957 Views
Last Modified: 2013-11-26
I need to have a batch file (or equivalent) which would retrieve a particular directory from my TFS to a specific location on my PC.

(A)
I tried to use the "get" command from the command line as below:
TF get $/myProject/Assets/UseCase /version:T /overwrite /recursive /noprompt

but got the error
Unable to determine the workspace.
(B)
I then tried
runas /noprofile /user:MYDOMAIN\user cmd

this prompted me for my password
I then entered the password and the cmd window was launched
I navigated to "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE>" (Installed in D drive) and tried
TF get $/myProject/Assets/UseCase /version:T /overwrite /recursive /noprompt

but got the error
Unable to determine the workspace.

Regards
Koshy75
0
Comment
Question by:koshy75
2 Comments
 
LVL 30

Accepted Solution

by:
SteveGTR earned 300 total points
ID: 20284254
I can't say specifically what the problem is, but a search on google finds a number of hits that might prove helpful:

http://www.google.com/search?q=%22Unable+to+determine+the+workspace%22+TF+get
0
 

Author Comment

by:koshy75
ID: 20333234
I needed to have a batch file which would retrieve a particular directory from my TFS to a specific location on my PC.
One main point which I missed out was that the "tf get" option would work only if launched from the mapped directory (which SteveGTR pointed out to me)

This is what I eventually did:
=====================================================================
Team Explorer (TFS) installed on D drive.
The path of tf.exe: "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe"

Source control folder: "$/myProject"
Specific section of source control sub-folder to be retreived by the batch file: "$/myProject/Assets/Flow Diagrams"

Mapped local folder: "C:\My Files"
Destination path: "C:\My Files\Assets\Flow Diagrams"

1. First navigate to the mapped local folder
      e.g. cd "c:\My Files\Assets\Flow Diagrams"
2. Execute tf.exe with the following options
      "D:\Program Files\Microsoft Visual Studio 8\Common7\IDE\tf.exe" get "$/myProject/Assets/Flow Diagrams" /all /recursive /noprompt

Note:
There are multiple other options for "tf get" which you could choose based on your requirements.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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