So often In Visual Studio find myself needing to get to a DOS prompt with the directory set to the current solutions folder. Strangely I find I do this with alarming regularity.
So today I just created a quick macro in visual studio that I've added to my main toolbar.
Here's the source
Imports SystemImports EnvDTEImports EnvDTE80Imports System.Diagnostics
Public Module RJMacros Public Sub OpenDos()
Dim currentSlnFolder As String
currentSlnFolder = DTE.Solution.FullName REM currentSlnFolder = DTE.ActiveDocument.Path If (String.IsNullOrEmpty(currentSlnFolder)) Then
Return End If
Debug.Print(currentSlnFolder) Dim lastpos = currentSlnFolder.LastIndexOf("\") currentSlnFolder = currentSlnFolder.Substring(0, lastpos) currentSlnFolder = """CD /d " + currentSlnFolder + """" Shell("cmd /K " + currentSlnFolder, AppWinStyle.NormalFocus, False, -1) End SubEnd Module
Of course the same could be used with minor modification for opening PowerShell.
Theme design by Jelle Druyts
Pick a theme: BlogXP calmBlue
My Virtual Earth Balloon Races www.racingballoon.com Richard JonesPowered By The Fridge Server