Solved

Microsoft, Team Foundation Source Control, Command Line get command

Posted on 2007-11-14
2
953 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
If like me you are one who spends a lot of time working and scripting with cmd.exe, sometimes it is handy to be able to quickly view a calendar for a given month and year. This script will quickly do just that!  Save the code posted below to a .bat …
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

912 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now