Click here to Skip to main content
15,609,235 members
Articles / Programming Languages / C++
Posted 26 Oct 2006


59 bookmarked

OpenFolder - An explorer shell extension

Rate me:
Please Sign up or sign in to vote.
4.26/5 (31 votes)
18 Jun 2008CPOL3 min read
A free tool which provides an explorer context menu to open a Command Prompt, now supports elevated Command Prompts on Vista.

Screenshot - openfolder.gif


I know this is a tiny little article and will probably get flamed, but it only a small utility and I have had several requests for its source code.

Some of you may find it useful anyway; I use it all the time.

OpenFolder is a shell extension which I wrote quite a while ago. It provides a new menu item on the Context Menu under Explorer.

The new menu item "Open Command Prompt Here" ... will open a Command Prompt box at the location of the file/folder that was selected when the menu was clicked.

OpenFolder runs as an explorer context menu shell extension and is written in C++ using ATL.


Simply download the setup kit, run it and click on 'Next', 'Install' and 'Finish'.

Once installed, right-click on a file or folder in explorer (or most other applications), then click on the 'Open Command Prompt Here...' menu item.

A new Command Prompt will be opened in the selected folder.

Windows Vista

OpenFolder now supports Elevated Command Prompts if it detects that it is running on Vista, see the screen shot above for the new "Open an Elevated Command Prompt Here..." menu item.

64-bit OpenFolder

I received an email from a user of OpenFolder saying that it did not work on XP x64. This is normal as 32-bit shell extensions cannot be loaded into a 64-bit Windows Explorer. I wanted to create a 64-bit version for them so I recompiled OpenFolder as a 64-bit appilcation and created a new setup kit to support the 64-bit install.

The 64-bit installation has been tested on 64-bit versions of XP and Vista.


This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.

Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

  • The origin of this software must not be misrepresented; you must not claim that you wrote the original software.
    If you use this software in a product, an acknowledgement in the product documentation would be appreciated but is not required.
  • Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software.
  • This notice may not be removed or altered from any source distribution.


  • 3.20 (Jun 17, 2008) - Updated the project to Visual Studio 2008 and created the 64-bit version and a new x64 setup kit.
  • 3.12 (Jun 21, 2007) - Fix on non-vista PC's where by version 3.11 broke the context menu.
  • 3.11 (June 10, 2007) - Fixed some bugs in the command processing code which was using the wrong command id's to determine what to process.
  • 3.10 (May 31, 2007) - Updated to support Windows Vista, including a new menu item for opening Elevated Command Prompts.
  • 3.01 (Mar 8, 2006) - Now compiled under Visual Studio .NET 2005, also the setup kit now created with NSIS.
  • 3.00 (Oct 22, 2005) - Rewrite to compile under Visual Studio.NET 2003. A few minor bug fixes too.
  • 2.00 (Apr 29, 2003) - Complete rewrite using ATL.
  • 1.00 (Apr 11, 1998) - Initial Public Release.


The shield icon does not display correctly in the context menu, the fix is to make the menu item owner draw. I intend to fix this when I have time.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Architect Elekta Limited
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

GeneralRe: Another Solution Pin
Jonathan [Darka]26-Oct-06 4:41
professionalJonathan [Darka]26-Oct-06 4:41 
GeneralRe: Another Solution Pin
toxcct26-Oct-06 4:43
toxcct26-Oct-06 4:43 
GeneralRe: Another Solution Pin
Jonathan [Darka]26-Oct-06 4:53
professionalJonathan [Darka]26-Oct-06 4:53 
GeneralRe: Another Solution Pin
David Crow31-Oct-06 3:02
David Crow31-Oct-06 3:02 
GeneralRe: Another Solution Pin
toxcct31-Oct-06 3:13
toxcct31-Oct-06 3:13 
GeneralRe: Another Solution Pin
Nonpareil31-Oct-06 4:25
Nonpareil31-Oct-06 4:25 
GeneralRe: Another Solution Pin
David Crow1-Nov-06 2:53
David Crow1-Nov-06 2:53 
GeneralRe: Another Solution Pin
MichP31-Oct-06 12:53
MichP31-Oct-06 12:53 
All these registry solutions only seem to work when you right-click a folder. This utility lets you click on a file and the prompt opens in that folder.
Wink | ;)
GeneralRe: Another Solution Pin
Jonathan [Darka]31-Oct-06 21:47
professionalJonathan [Darka]31-Oct-06 21:47 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.