Right Click to Open Command Prompt in Directory

by Pete Freitag

Here's a handy tip that I got from a co-worker, who found it in the book Microsoft Visual C# .NET Step by Step. It creates a shortcut in the right click context menu of Windows Explorer to open a command prompt in the current directory. When I need to run scripts in a very long directory name, this is very handy.

So here's how you set it up:

You can also use this feature to attach context actions to file types. Or if you want to create a right click open with option for any file type (for instance I like to be able to open any file with notepad, see: my blog entry here.

Comments

Sudhakar G

Wonderful tip.

John

I did this and now I cant disable it or delete the entry in the advanced tab. All of my files attempt to open with cmd.exe. I cant change the default back to "open". HELP.

hi

i need help.. i cant open cmd on this crack of a school computer that thing they are so well protected. help me

NGNeer

Very useful indeed. I wrote a complimentary shell extension for those cases where you're already inside the directory you want the command prompt to start in, but you don't want to have to go up one level just to right-click the folder. It's called BackgroundCMD, and it lets you start cmd.exe from the context menu of the folder background. It's also good for start cmd.exe from the desktop, without having to go to your user folder under "C:\Documents and Settings". http://www.roggel.com/NGNeer/BackgroundCMD Regards, NGNeer.

Sudhanva

I did this and now I cant disable it or delete the entry in the advanced tab. All of my files attempt to open with cmd.exe. I cant change the default back to "open". Can anyone plz tell me how could i remove this option.. HELP!!

Rajib

Sudhava, Thanks a trillion ... wonderful solution!!!

Antonieta

Hi: i have a problem with open any folder, the "open" option is tha last of the tree when i right click, the default option is "search", so everytime i tried to open a folder, the search windows display. I even tried to change from the filetypes list in the toolbar, but doesn't appear the "open" option, only "find" (that is bolded). Please help me, because it's awful work like this. P.D: excuse my poor english, i don't speak it well

suman

hi everybody, To open a command prompt from the right click menu manually,as everybody said i could not find the directory [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell in my system.i could find upto [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder thats it.can any body celar my doubt.

fedmich

How do I add an icon on the left side of the menu? Thanks in advance

Rick

Because cmd.exe is on the path, you don't really need to specify anything but "cmd.exe" in the field.

sankar

how do i remove Right Click to Open Command Prompt in Directory

sankar

I did this and now I cant disable it or delete the entry in the advanced tab. All of my files attempt to open with cmd.exe. I cant change the default back to "open". Can anyone plz tell me how could i remove this option.. HELP!!

Sina

hi i a question for get get selected directory name in vb.net or c#.net i add an item to right click folder with folder/shell and ... but i want get selected folder name in application time user do right click on the a folder and select my item thank you

Prasenjit

Excellent tip.... Very useful

saha

anyone who have problem to change back to normal please use this tip it will help you. -goto run then type regedit -goto hkey_classes_root->directory->shell -modified the default data value to "none" -then finish.

jhun

how to delete the undeleted software use the command prompt

Joeri

Anybody know how to remove the "Delete" or "Rename" form the right click menu?

giji_DVE

Is there any method to retrieve the name of selected folder in Windows Explorer in C#? I need to read the files in the selected folder, for that I have to find out the name of the selected folder. Please Help

Terry

How do I remove Command Promt from ... EVERY THING now that asks for it. I have no idea what I did to get it there but it is annoying and I don't know what to tell the damned thing. I messed around by accident and found if I used the 'explore' option it would allow me to see what's in a folder.