Click here to Skip to main content
15,908,444 members
Articles / Programming Languages / C#
Article

Command Prompt Explorer Bar

Rate me:
Please Sign up or sign in to vote.
4.93/5 (184 votes)
10 Jun 20023 min read 1.4M   23.9K   356   265
This tool extends explorer with functionality of a command prompt. Implemented as a band object completely in C#. Demonstrates COM Interop and P/Invoke, windows hooking and API interception. Finally you can run all these .Net SDK tools and ‘Hello World!’ programs without leaving explorer shell.

Introduction

The Command Prompt Explorer Bar is a small tool that extends Windows Explorer.

Version 1.1 is now available.

Ever tried to run one of those console programs ("Hello World!" to name a few), .BAT, .VBS or .JS scripts just to see black window popping up and disappearing? I did. Especially after I started using .Net framework I find myself doing this more often. No wonder - with all this ALs , NGENs and TLBIMPs. So if you are like me then this tool is right for you. Next time you need to run a program without GUI, just press the 'Ctrl+M' key combination in your explorer. A command prompt will start and appear automatically. Its current directory will be exactly the same as the current path you are browsing. And better yet the console will appear inside your explorer window - like any other explorer bar does - 'History', 'Favorites', 'Folders' etc. Now you can have the best of both worlds combined together - easy and fast navigation of explorer and power of batch processing of the command prompt. Or should I say Command Prompt Explorer Bar:

Image 1

Well, that is how it looks like. Isn't it a beauty?

You may have noticed a toolbar on the left of the console window. I tried to put some nice timesaving features there. The most powerful is a button with a 'Script' icon on it. It has a drop down menu where you can select a command you like to be executed. It even knows how to substitute '{0}' for the name of the current files selected in explorer. Here is when it can be useful. Let's say you want to install your assembly into a 'Native Images Cache'. With Command Bar it is as simply as selecting your assembly in explorer and clicking on 'ngen {1}' menu item. It also works just fine for multiple selected files (use {0} instead). Now you can compile your .cs or .vbs files without leaving a comfortable explorer shell. And yes, you can change this menu and scripts the way you like them. It is as simple as editing a text file in a Notepad.

And here is another (besides pressing 'Ctrl+M') way of starting this tool:

Image 2

I hope you'll enjoy this little tool. Send me your comments, requests and bug reports to PavelZolnikov@yahoo.com.

History

  • 5/31/2002, 1.0 - original version.
  • 6/11/2002, 1.1 - bug fixes. NOTE: if you were using version 1.0 and have customized macro.xml file, you might want to save its backup version somewhere before uninstalling.
    • New setup. Hopefully without issues like in previous version. Thanks to Michael Dunn for his tip.
    • Fixed an issue with CMD.EXE failing to start. CreateProcess interception is now scoped by instances of Folder Windows and enabled only if CommandBar is visible. 'Launch folder windows in a separate process’ is no more required.
    • Integrated keyboard focus with explorer. Now Command Prompt window is reachable through Tab and Shift+Tab keys.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
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: Why would you do it in C#???!!!... Pin
Stephane Rodriguez.6-Sep-02 13:33
Stephane Rodriguez.6-Sep-02 13:33 
GeneralRe: Why would you do it in C#???!!!... Pin
Anonymous2-Oct-02 7:50
Anonymous2-Oct-02 7:50 
GeneralRe: Why would you do it in C#???!!!... Pin
17-Jun-02 7:44
suss17-Jun-02 7:44 
GeneralRe: Why would you do it in C#???!!!... Pin
17-Jun-02 17:08
suss17-Jun-02 17:08 
GeneralRe: Why would you do it in C#???!!!... Pin
18-Jun-02 5:22
suss18-Jun-02 5:22 
GeneralRe: Why would you do it in C#???!!!... Pin
19-Jun-02 2:35
suss19-Jun-02 2:35 
GeneralRe: Why would you do it in C#???!!!... Pin
19-Jun-02 17:44
suss19-Jun-02 17:44 
GeneralRe: Why would you do it in C#???!!!... Pin
20-Jun-02 5:37
suss20-Jun-02 5:37 
Hi,

I haven't experienced the same memory issues as you. I develop on Windows 2000 and Windows XP. As an informal test I've compiled a small Windows Forms app on my Windows 2000 box with a menu bar and an OnPaint() routine which displays a scaled bitmap. This uses a few assemblies more than a typical Hello World app, but the memory footprint is between 5 and 6 MB depending on whether it is a Debug or Release build. Compiling it to native code shaves a few K off this, too, and makes it a bit faster. Even loading up Web Matrix (see www.asp.com), a massive ASP.NET development environment from MS, takes up 27MB, still 5 meg leaner than your suggested minimum. These figures are from a cold-booted system, so I'm assuming no libraries are retained in memory. I can't explain the differences with your figures, but please let me know if you find out.

I think running ngen is a valid step for a program like the Command Prompt one, which is specifically tied in to Windows. For more general programs which could feasibly run on a variety of platforms you can run ngen as a step in the installation process on the client machine, getting the benefit of speed and portability.

The ability to have different versions of assemblies side by side is vital to creating a robust environment over time. Programs by default target the latest versions, but can be configured simply to run with an older version if the newer one breaks compatibility. This avoids the main cause of DLL Hell. One would hope that Microsoft gets all its releases correct, but having the core assemblies versioned as well means that even if they do get it wrong and break your old program, you can distribute a simple XML config file to your clients to fix it without having to rebuild. I believe MFC programmers have experienced this problem sometimes when new versions are released. Luckily because the assemblies are quite finely grained, updates do not have to be massive if only a few changes are required.

I think we will see many Windows Forms applications being released in the coming months, by MS and independent vendors. Updates and bug fixes can be much quicker thanks to the development environment and the FCL being so mature and rich for a version 1.0 product. We'll see what happens, but it's still great to have the choice no matter what your preferred environment is Smile | :)

Cheers,

Dave
GeneralRe: Why would you do it in C#???!!!... Pin
20-Jun-02 17:36
suss20-Jun-02 17:36 
GeneralRe: Why would you do it in C#???!!!... Pin
20-Jun-02 21:58
suss20-Jun-02 21:58 
GeneralRe: Why would you do it in C#???!!!... Pin
Stephane Rodriguez.30-Aug-02 20:48
Stephane Rodriguez.30-Aug-02 20:48 
GeneralRe: Why would you do it in C#???!!!... Pin
20-Jun-02 17:47
suss20-Jun-02 17:47 
GeneralRe: Why would you do it in C#???!!!... Pin
Anonymous19-Jul-02 5:27
Anonymous19-Jul-02 5:27 
GeneralRe: Why would you do it in C#???!!!... Pin
Anonymous22-Jul-02 21:18
Anonymous22-Jul-02 21:18 
GeneralRe: Why would you do it in C#???!!!... Pin
Anonymous26-Jul-02 21:25
Anonymous26-Jul-02 21:25 
GeneralRe: Why would you do it in C#???!!!... Pin
Stephane Rodriguez.30-Aug-02 20:50
Stephane Rodriguez.30-Aug-02 20:50 
GeneralRe: Why would you do it in C#???!!!... Pin
igor196011-Jul-03 7:44
igor196011-Jul-03 7:44 
GeneralRe: Why would you do it in C#???!!!... Pin
James White5-Sep-02 3:52
James White5-Sep-02 3:52 
GeneralRe: Why would you do it in C#???!!!... Pin
skafoelix31-Jul-08 2:07
skafoelix31-Jul-08 2:07 
GeneralYes it is... Pin
NormDroid12-Jun-02 7:05
professionalNormDroid12-Jun-02 7:05 
GeneralRe: Yes it is... Pin
23-Jun-02 20:15
suss23-Jun-02 20:15 
QuestionHow can I get hotkeys / accelerators working? Pin
Chris Hambleton12-Jun-02 5:26
Chris Hambleton12-Jun-02 5:26 
AnswerRe: How can I get hotkeys / accelerators working? Pin
Pavel Zolnikov12-Jun-02 6:04
Pavel Zolnikov12-Jun-02 6:04 
GeneralAlternative command processor Pin
Thomas Freudenberg12-Jun-02 1:29
Thomas Freudenberg12-Jun-02 1:29 
GeneralRe: Alternative command processor Pin
Pavel Zolnikov12-Jun-02 4:32
Pavel Zolnikov12-Jun-02 4:32 

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.