Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I found a simple solution for my needs, which is based on a small batch script, that you'll have to click. It's not a shortcut so to say even though you can still create a shortcut of the batchfile.</p> <p>Here's the script:</p> <pre><code>CALL "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86 REG ADD "HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\&lt;GUIDofTFS&gt;" /v "SceMostRecentPath" /d "$/&lt;PathToTfsProject&gt;" /f devenv /Command View.TfsSourceControlExplorer </code></pre> <p>In fact I combined 2 ideas found in separate sources:</p> <p><b>1. <a href="https://stackoverflow.com/questions/2907614/automatically-open-source-control-explorer-when-visual-studio-starts-up">Start VS with Source Control Explorer</a></b></p> <p><b>2. <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/5b77a03b-ccc0-48ab-bb59-da98db231759/cannot-set-current-tfs-workspace-in-visual-studio-2010-programmatically" rel="nofollow noreferrer">Manipulate Registry to open Source Control Explorer in a specific path</a></b><br></p> <p>With the command <code>devenv /Command View.TfsSourceControlExplorer</code> you can actually start VS and automatically open Source Control Explorer. Unfortunately there is no way to give a parameter to point it directly to a location you wish. But I noticed that VS2010 seems to persist the last used path and reopens to that place on restarts. A quick research resulted in the registry entry </p> <blockquote> <p>HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\058104ed-f0e2-4126-9ccc-0e37e19c4f91\SceMostRecentPath</p> </blockquote> <p>By manipulating the value of <code>SceMostRecentPath</code> you can trick VS2010 to open Source Control Explorer with the path in there. Keep in mind: You will need to replace <code>058104ed-f0e2-4126-9ccc-0e37e19c4f91</code> with the GUID of your TFS Installation.</p> <p><br>Since we are all using VS 2010 but the installation paths differ, I implemented the path dynamically by making use of the VS100COMNTOOLS variable. First we set up the TFS command line environment: </p> <pre><code>CALL "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86` </code></pre> <p>Then we change the registry:</p> <pre><code>REG ADD "HKCU\Software\Microsoft\VisualStudio\10.0\TeamFoundation\SourceControl\Explorer\[PutYourTfsGUIDHere]" /v "SceMostRecentPath" /d "$/&lt;YourTfsPath&gt;" /f </code></pre> <p>Finally we do a simple call of devenv.exe with the source Explorer command:</p> <pre><code>devenv /Command View.TfsSourceControlExplorer </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload