Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Open containing folder" hotkey in Visual Studio 2012

In versions of Visual Studio before 2012, I was able to create a hotkey to perform "Open Containing Folder" for the current active text file. I accomplished this by creating a macro that had a keystroke assigned to it.

Visual Studio 2012 does not have macros. How would I accomplish the above in this version?

like image 610
GaTechThomas Avatar asked Sep 20 '12 18:09

GaTechThomas


People also ask

How do I open a folder in Visual Studio 2012?

To open a folder that contains your source files: In Visual Studio, click File > Open > Folder. Navigate to the folder, and click Select Folder. This opens the folder in Solution Explorer and displays its contents, files and any subfolders.

How do I open a folder in Visual Studio?

On the Visual Studio menu bar, choose File > Open > Folder, and then browse to the code location. On the context (right-click) menu of a folder containing code, choose the Open in Visual Studio command. Choose the Open Folder link on the start window.

How do you open a file containing?

Right-click on an item. Choose JustCode | Open Containing Folder.

What is Open containing folder?

“Open Containing Folder” is one of the frequent used functionality to open a particular file location in windows explore from Visual Studio IDE . How did we do that ? Yes it's very simple, Just right click on file from files Tab and select “Open Containing Folder” from the context menu as shown in below.


2 Answers

Unfortunately you'll now need to download the VSSDK and create a VSPackage to do that, now that macros have been dropped from the IDE.

The closest thing to a macro now is a PowerShell script, which you could run from the console but I'm not aware of any way to assign a keyboard shortcut to it.

Running PS outside of the IDE is an option (via an External Tool command with a keyboard shortcut configured), but obtaining the EnvDTE outside of process could be complicated.

EDIT: There is a much simpler solution. I can't believe I didn't realise it to begin with!

Simply go into Tools... Options... Environment... Keyboard locate File.OpenContainingFolder and assign a shortcut. This command will open the active document's containing folder.

like image 175
Dan Nolan Avatar answered Oct 20 '22 03:10

Dan Nolan


I found a keyboard shortcut for Open Containing Folder: Alt + - + O

When you press Alt + - it opens Tab Context Menu Then you see that the shortcut key for Open Containing Folder is O key, then you should press O.

Menu

like image 25
Mohamad Shiralizadeh Avatar answered Oct 20 '22 03:10

Mohamad Shiralizadeh