<p>I frequently work with multiple instances of Visual Studio, often working on different branches of the same solution.</p>

<p><a href="https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B#Strictly_32-bit_versions" rel="noreferrer">Visual C++ 6.0</a> used to display the full path of the current source file in its title bar, but Visual&nbsp;Studio 2005 doesn't appear to do this. This makes it slightly more awkward than it should be to work out which branch of the solution I'm currently looking at (the quickest way I know of is to hover over a tab so you get the source file's path as a tooltip).</p>

<p>Is there a way to get the full solution or file path into the title bar, or at least somewhere that's always visible, so I can quickly tell which branch is loaded into each instance?</p>

[{'answer_id': 30532, 'author': 'Adam Haile', 'author_id': 194, 'author_profile': 'https://Stackoverflow.com/users/194', 'pm_score': 6, 'selected': True, 'text': '<p>There is not a native way to do it, but you can achieve it with a macro. The details are described here in full: <em><a href="https://www.helixoft.com/blog/how-to-show-full-file-path-or-anything-else-in-vs-2005-title-bar.html" rel="nofollow noreferrer">How To Show Full File Path (or Anything Else) in VS 2005 Title Bar</a></em></p>\n\n<p>You just have to add a little Visual Basic macro to the EvironmentEvents macro section and restart Visual Studio.</p>\n\n<p>Note: The path will not show up when you first load Visual Studio, but it will whenever you change which file you are viewing. There is probably a way to fix this, but it doesn\'t seem like a big deal.</p>\n'}, {'answer_id': 353999, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>Related note: As an alternative, for Visual Studio 2005 you can use the command menu <em>File</em> &rarr; <em>Advanced Save Options</em>. The dialog displays the full path of the current file, and you are able to copy the text.</p>\n'}, {'answer_id': 1433048, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 2, 'selected': False, 'text': '<p>It\'s awkward indeed. Hovering on the tab is indeed one of the few things useful.</p>\n\n<p>Alternative: right click on the file tab: <em><a href="http://weblogs.asp.net/piseth/archive/2008/11/08/find-your-file-path-in-visual-studio.aspx" rel="nofollow noreferrer">Find your File Path in Visual Studio</a></em>. It seems we have to do with that.</p>\n'}, {'answer_id': 5831947, 'author': 'Registered User', 'author_id': 436138, 'author_profile': 'https://Stackoverflow.com/users/436138', 'pm_score': 4, 'selected': False, 'text': '<p>Check out the latest release of <a href="http://vscommands.com/download" rel="nofollow noreferrer">VSCommands 2010 Lite</a>. It introduced a feature called Friendly Solution Name where you can set it to display the solution file path (or any part of it) in Visual Studio\'s main window title.</p>\n\n<p>More details: <a href="http://vscommands.com/releasenotes/3.6.8.0" rel="nofollow noreferrer">http://vscommands.com/releasenotes/3.6.8.0</a> and <a href="http://vscommands.com/releasenotes/3.6.9.0" rel="nofollow noreferrer">http://vscommands.com/releasenotes/3.6.9.0</a></p>\n'}, {'answer_id': 5870729, 'author': 'Drew Miller', 'author_id': 459949, 'author_profile': 'https://Stackoverflow.com/users/459949', 'pm_score': 3, 'selected': False, 'text': '<p>For Visual&nbsp;Studio&nbsp;2008, a slightly better way to write the macro from the accepted answer is to use the Solution events instead of the document ones - this lets you always edit the title bar, even if you don\'t have a document selected.</p>\n\n<p>Here\'s the macro my coworker and I put together based on the other one - you\'ll want to change lines 15-18 to pull your branch name from the source directory for however you\'re set up.</p>\n\n<pre><code>Private timer As System.Threading.Timer\n\nDeclare Auto Function SetWindowText Lib "user32" (ByVal hWnd As System.IntPtr, ByVal lpstring As String) As Boolean\n\nPrivate _branchName As String = String.Empty\n\nPrivate Sub SolutionEvents_Opened() Handles SolutionEvents.Opened\n    Try\n        If timer Is Nothing Then\n            \' Create timer which refreshes the caption because\n            \' IDE resets the caption very often\n            Dim autoEvent As New System.Threading.AutoResetEvent(False)\n            Dim timerDelegate As System.Threading.TimerCallback = _\n                AddressOf tick\n            timer = New System.Threading.Timer(timerDelegate, autoEvent, 0, 25)\n        End If\n        Dim sourceIndex As Integer = DTE.Solution.FullName.IndexOf("\\Source")\n        Dim shortTitle As String = DTE.Solution.FullName.Substring(0, sourceIndex)\n        Dim lastIndex As Integer = shortTitle.LastIndexOf("\\")\n        _branchName = shortTitle.Substring(lastIndex + 1)\n        showTitle(_branchName)\n    Catch ex As Exception\n\n    End Try\nEnd Sub\n\n\nPrivate Sub SolutionEvents_BeforeClosing() Handles SolutionEvents.BeforeClosing\n    If Not timer Is Nothing Then\n        timer.Dispose()\n    End If\nEnd Sub\n\n\n\'\'\' &lt;summary&gt;Dispose the timer on IDE shutdown.&lt;/summary&gt;\nPublic Sub DTEEvents_OnBeginShutdown() Handles DTEEvents.OnBeginShutdown\n    If Not timer Is Nothing Then\n        timer.Dispose()\n    End If\nEnd Sub\n\n\n\'\'\'&lt;summary&gt;Called by timer.&lt;/summary&gt;\nPublic Sub tick(ByVal state As Object)\n    Try\n        showTitle(_branchName)\n    Catch ex As System.Exception\n    End Try\nEnd Sub\n\n\n\'\'\'&lt;summary&gt;Shows the title in main window.&lt;/summary&gt;\nPrivate Sub showTitle(ByVal title As String)\n    SetWindowText(New System.IntPtr(DTE.MainWindow.HWnd), title &amp; " - " &amp; DTE.Name)\nEnd Sub\n</code></pre>\n'}, {'answer_id': 6586069, 'author': 'Bruno Vinicius', 'author_id': 830119, 'author_profile': 'https://Stackoverflow.com/users/830119', 'pm_score': 5, 'selected': False, 'text': '<p>This is a extension available in the online gallery specifically tailored for this job. Checkout <em><a href="http://erwinmayer.com/labs/visual-studio-2010-extension-rename-visual-studio-window-title/" rel="nofollow noreferrer">Labs > Visual Studio Extension: Customize Visual Studio Window Title</a></em>.</p>\n'}, {'answer_id': 10439684, 'author': 'Lee WIllis', 'author_id': 1373661, 'author_profile': 'https://Stackoverflow.com/users/1373661', 'pm_score': 1, 'selected': False, 'text': '<p>Use the MKLINK command to create a link to your existing solution. As far as Visual Studio is concerned, it\'s working with the link file, but any changes go to the underlying .sln file.</p>\n\n<p>I wrote a blog entry here about it...</p>\n\n<p><a href="http://willissoftware.com/?p=72" rel="nofollow noreferrer">http://willissoftware.com/?p=72</a></p>\n'}, {'answer_id': 10445459, 'author': 'Leroy', 'author_id': 1077358, 'author_profile': 'https://Stackoverflow.com/users/1077358', 'pm_score': 1, 'selected': False, 'text': '<p>For the people that didn\'t get the VB method to work (like me) you can use a plugin:</p>\n\n<p><em><a href="http://visualstudiogallery.msdn.microsoft.com/f3f23845-5b1e-4811-882f-60b7181fa6d6" rel="nofollow noreferrer">Customize Visual Studio Window Title</a></em></p>\n\n<p>It was tested it in Visual&nbsp;Studio&nbsp;2008 Ultimate. You can configure it in the <em>Options</em> menu of Visual&nbsp;Studio.</p>\n'}, {'answer_id': 11224520, 'author': 'superlogical', 'author_id': 52360, 'author_profile': 'https://Stackoverflow.com/users/52360', 'pm_score': 2, 'selected': False, 'text': '<p>I am using VSCommands 10 to show the full path of the solution file open.</p>\n\n<pre><code>Friendly Name: {repo}\nSolution Path Regex: (?&lt;repo&gt;.*)\n</code></pre>\n\n<p>Now my main title window looks like this:</p>\n\n<pre><code>c:\\repositories\\acme.marketplace.trunk\\Acme.Marketplace.web\\Acme.Marketplace.Web.sln\n</code></pre>\n\n<p>I can quickly glance and see that I am working in the trunk folder or a rc folder because we use Mercurial (Hg) and keep separate folders for trunk, rc, preprod, prod like this:</p>\n\n<pre><code>c:\\repositories\\acme.marketplace.rc1\nc:\\repositories\\acme.marketplace.rc2\nc:\\repositories\\acme.marketplace.trunk\nc:\\repositories\\acme.marketplace.preprod\nc:\\repositories\\acme.marketplace.prod\n</code></pre>\n'}, {'answer_id': 29597246, 'author': "Muad'Dib", 'author_id': 2000151, 'author_profile': 'https://Stackoverflow.com/users/2000151', 'pm_score': 0, 'selected': False, 'text': '<p>If you are using Visual&nbsp;Studio&nbsp;2010 or above you can you the extension "Visual Studio Window Title Changer".</p>\n\n<p>Install this and use the following \'Window Title Setup\' expression to display the solution path:</p>\n\n<pre><code>\'sln_dir + "/" + orig_title\'\n</code></pre>\n\n<p>Use the extension manager to download and install the extension. Details of the extension and how to use it can be found here:</p>\n\n<p><a href="https://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239?SRC=VSIDE" rel="nofollow noreferrer">https://visualstudiogallery.msdn.microsoft.com/2e8ebfe4-023f-4c4d-9b7a-d05bbc5cb239?SRC=VSIDE</a></p>\n'}, {'answer_id': 44677185, 'author': 'YanZhiwei', 'author_id': 4298295, 'author_profile': 'https://Stackoverflow.com/users/4298295', 'pm_score': 2, 'selected': False, 'text': '<h3>How to customise the Visual Studio window title</h3>\n<p>Install the <a href="https://marketplace.visualstudio.com/items?itemName=mayerwin.RenameVisualStudioWindowTitle" rel="nofollow noreferrer">Customize Visual Studio Window Title</a> plugin.</p>\n<p>After installing the extension, the settings can be found in the menu.</p>\n<p>Menu <em>Tools</em> ► <em>Options</em> ► <em>Customize VS Window Title</em>.</p>\n<p><strong>More information</strong></p>\n<p><em>Customize Visual Studio Window Title</em> is a lightweight extension to Visual Studio, which allows you to change the window title to include a folder tree:</p>\n<p><a href="https://i.stack.imgur.com/ava9j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ava9j.png" alt="Enter image description here" /></a></p>\n<h3>Features</h3>\n<ul>\n<li>A configurable minimum and maximum depth distance from the solution/project file</li>\n<li>Allows the use of special tags to help with many other possible scenarios, which include <a href="https://en.wikipedia.org/wiki/Git" rel="nofollow noreferrer">Git</a>, <a href="http://en.wikipedia.org/wiki/Mercurial" rel="nofollow noreferrer">Mercurial</a>, and <a href="http://en.wikipedia.org/wiki/Team_Foundation_Server" rel="nofollow noreferrer">TFS</a>.</li>\n</ul>\n'}, {'answer_id': 50200529, 'author': 'jciloa', 'author_id': 5124002, 'author_profile': 'https://Stackoverflow.com/users/5124002', 'pm_score': 2, 'selected': False, 'text': '<p>As <a href="https://stackoverflow.com/users/1764696/dan">Dan</a> also mentioned it in a comment, the <a href="https://marketplace.visualstudio.com/items?itemName=ShemeerNS.FilePathOnFooter" rel="nofollow noreferrer">File Path On Footer</a> extension serves the same purpose.</p>\n'}, {'answer_id': 52082493, 'author': 'KyleMit', 'author_id': 1366033, 'author_profile': 'https://Stackoverflow.com/users/1366033', 'pm_score': 1, 'selected': False, 'text': '<h2><a href="https://tabsstudio.com/" rel="nofollow noreferrer">TabsStudio</a> | US$49</h2>\n\n<p>It is a pretty good (although paid) Visual Studio extension that provides:</p>\n\n<ul>\n<li>Tab grouping</li>\n<li>Tab coloring</li>\n<li>Title transformation</li>\n<li>Lots of customization and extensions</li>\n</ul>\n\n<p><a href="https://i.stack.imgur.com/mDFfb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mDFfb.png" alt="Tabs Studio Screenshot"></a></p>\n\n<h2><a href="https://marketplace.visualstudio.com/items?itemName=ShemeerNS.FilePathOnFooter" rel="nofollow noreferrer">File Path On Footer</a> | Free</h2>\n\n<p>It displays the full file path on the bottom of the editor window:</p>\n\n<p><a href="https://i.stack.imgur.com/7Bd7o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7Bd7o.png" alt="File Path On Footer Screenshot"></a></p>\n\n<h2>Honorable Mention: Visual Studio Code</h2>\n\n<p>Visual Studio Code <a href="https://code.visualstudio.com/updates/v1_26#_breadcrumbs" rel="nofollow noreferrer">version 1.26 implemented breadcrumbs</a> which displays the file path in a separate row at the top of the editor window when using tabs or inline the file name when in its own window.</p>\n\n<p><a href="https://i.stack.imgur.com/Kbo6i.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Kbo6i.png" alt="Visual Studio Code Breadcrumbs Screenshot"></a></p>\n'}, {'answer_id': 67841083, 'author': 'Jason LeMonier', 'author_id': 1161298, 'author_profile': 'https://Stackoverflow.com/users/1161298', 'pm_score': -1, 'selected': False, 'text': '<p>File &gt; Preferences &gt; Settings &gt;&gt; Window:Title</p>\n<p>I just changed ${activeEditorShort} =&gt; ${activeEditorLong}</p>\n<p>within the setting:\n${dirty}${activeEditorLong}${separator}${rootName}${separator}${appName}</p>\n<p>Worked immediately when I clicked a file.</p>\n<p>Great help right in the setting ...</p>\n<p>Window: Title --\nControls the window title based on the active editor. Variables are substituted based on the context:</p>\n<p>${activeEditorShort}: the file name (e.g. myFile.txt).</p>\n<p>${activeEditorMedium}: the path of the file relative to the workspace folder (e.g. myFolder/myFileFolder/myFile.txt).</p>\n<p>...</p>\n<p>Visual Studio Code\nVersion: 1.56.2\nDate: 2021-05-12</p>\n<p>I found one reference saying this existed since 2017.</p>\n'}]
['https://Stackoverflow.com/questions/30505', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1739/']