Monday, May 22, 2006 11:47 AM
is it possible to get latest version of file to any location I want with tf?
Not just to the workspace
Monday, May 22, 2006 12:35 PM
unfortunatelly no - get is always performed to the mapped location. You can look at tf view command, it let you download copy of the file to the temporar location.
Monday, May 22, 2006 12:46 PM
Is there a way to prevent the file from being viewed ?
Monday, May 22, 2006 1:19 PM
Use /console switch and redirect output to the file:
tf view /console foo.txt > c:\foo.txt
Monday, May 22, 2006 2:09 PM
The command I try is
view /s:server-cm $/prod/Development/Projects/Common/Utils/MMC.exe > c:\\MMC.exe"
When I run the command from the command line it works fine.
When I run it from cod I get "illegal characters in path"
my code is
System.Diagnostics.ProcessStartInfo psi =new System.Diagnostics.ProcessStartInfo("tf.exe",args);
psi.UseShellExecute =false ;
System.Diagnostics.Process p =
Where args is view /s:server-cm $/prod/Development/Projects/Common/Utils/MMC.exe > c:\\MMC.exe"
Monday, May 22, 2006 4:57 PMModeratorI don't think you can use '>' that way with Process.Start. Maybe if you set UseShellExecute to true.
Instead of doing it that way, capture the stdout into a stream and write it to disk using System.IO.FileStream.
Even better: use the TFS object model: VersionControlServer.DownloadFile()
Monday, May 22, 2006 8:48 PM
But Downloadfile() would work from 2005 only ? The reason I use tf.exe is because I need it to run in 1.1 framework
Monday, May 22, 2006 10:17 PMModeratorYou're right. I don't think you can reference our product DLLs from 1.1 code.
Tuesday, May 23, 2006 7:39 AM
this is what I've tried
stringargs ="view /s:server-cm $/prod/Development/Projects/Processes/AssemblyInfo.cs /console";
System.Diagnostics.Process p =new System.Diagnostics.Process();
p.StartInfo.Arguments = args ;
p.Start();string output = p.StandardOutput.ReadToEnd();
But the output param is empty.
Tuesday, May 23, 2006 1:07 PM
Could you add to your code
and check if
contains any errors?