Solved

Microsoft, Team Foundation Source Control, Command Line get command

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

How Do You Stack Up Against Your Peers?

With today’s modern enterprise so dependent on digital infrastructures, the impact of major incidents has increased dramatically. Grab the report now to gain insight into how your organization ranks against your peers and learn best-in-class strategies to resolve incidents.

Question has a verified solution.

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

This article was inspired by a question here at Experts Exchange (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28629170.html). The requirements stated in that question are (1) reduce the file size of a large number of…
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

820 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