I'm Michael Suodenjoki - a software engineer living in Kgs. Lyngby, north of Copenhagen, Denmark. This is my personal site containing my blog, photos, articles and main interests.

Article

Command Prompt in Explorer Context MenuTip for starting a command prompt from Windows Explorer

Updated 2011.01.23 17:22 +0100

Ikke tilgængelig på Dansk

By Michael Suodenjoki, michael@suodenjoki.dk.

Version 1.0 January 2003.

Abstract

This tiny article describes a tip of how you setup your Windows system so that you easily can start up a command prompt in the selected folder from within the Windows Explorer context menu. The tip works both on Windows 2000 and Windows XP.

Contents

1 Introduction
2 How to

Feedback

I've been looking for something to launch a shell from explorer for a while. Thanks.
Ron Belaire, 2003.12.11
I just ran across your tip on the web. I use this feature all the time at work on Windows NT. At one point a while back, I found some documentation on it (I don't remember where), but it said NOT to use it on Windows 98. I run Windows 98 at home, and would love to have this feature at home. Will what you presented in your article work on Windows 98? [Yes, I think so.]
Erik P. Verret
Harris Corporation, GCSD, 2003.04.30

1 Introduction

The best way to open a command prompt in a selected folder from Explorer is to add a context menu option to folders that will then open a command prompt at the selected folder.

Figure illustrating handy Command Prompt menu item in the Explorer context menu.

2 How to

  1. Startup the Registry Editor (regedit.exe) using the Start menu's Run menu. Simply type in: regedit

    The Run dialog
  2. Browse to the HKEY_CLASSES_ROOT\Folder\Shell key.
  3. Add a new key (using the Edit menu or the context menu) and name it: MenuText.
  4. Double-click the default of the new key and enter the text you want to display when you right-click a folder (e.g. "Command Prompt").
  5. Select the key MenuText and add a new key under it called "Command." Double-click the default value of this key and enter:

      <system dir>\System32\Cmd.exe /k cd "%1"

    where you must substitute the <system dir> with the your systems Windows directory (e.g., C:\Windows or C:\Winnt).

    The Registry Editor in action
  6. Close the Registry editor.

You don't have to reboot the machine for this to work. Now, when you select a folder in Explorer and right-click, a new option in the menu called Command Prompt takes you to the currently selected folder.

Hope you can use it.

Tip also available at: http://www.microsoft.com/windows2000/techenthusiast/tricks/administration/registry.asp