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?
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.
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.
Right-click on an item. Choose JustCode | 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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With