Open Command Prompt


Here is a simple code to edit registry setting to add a context menu for the directory. When you right click on the directory in the explorer it show an additional menu item to open the command prompt at the selected directory. I found this as a handy way of opening a command prompt. Following is the content of the reg file:


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Classes\Folder\Shell\Command Prompt]
@="Open Console here"

[HKEY_CURRENT_USER\Software\Classes\Folder\Shell\Command Prompt\Command]
@="Cmd.exe /k pushd %L"


In case you use Power-Shell, the content of the reg file would look something like as below:


Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Directory\shell\powershell]
@="PowerShell Here"

[HKEY_CLASSES_ROOT\Directory\shell\powershell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit –Command Set-Location -LiteralPath '%L'"

Save the content in a file with .reg extension and then double-click on the icon of the file. It would give you a warning message indicating that changing the registry setting may cause components to stop working correctly. So, though I would say it is safe to make such change in registry, use this utility at your own risk. :-)

Open Command Prompt Open Command Prompt Reviewed by Sourabh Soni on Tuesday, September 29, 2009 Rating: 5

No comments

Author Details

Image Link [https://3.bp.blogspot.com/-zo21XIdyPqc/VuTrFfUyPhI/AAAAAAAAAO8/EEWTN73XHUA7aTIjuxuBSN-WGaGkNUymA/s1600/sourabhdots3.jpg] Author Name [Sourabh Soni] Author Description [Technocrat, Problem Solver, Corporate Entrepreneur, Adventure Enthusiast] Facebook Username [sourabh.soni.587] Twitter Username [sourabhs271] GPlus Username [#] Pinterest Username [#] Instagram Username [#] LinkedIn Username [sonisourabh] Youtube Username [sonisourabh] NatGeo Username [271730]