Welcome Guest.   Make a donation to an author on the site October 31, 2014, 03:32:11 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Your Support Funds this Site: View the Supporter Yearbook.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: SOLVED: Open command prompt at current directory  (Read 11764 times)
Deozaan
Charter Member
***
Posts: 6,438



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« on: June 16, 2010, 01:39:19 PM »

I've been playing around with Mercurial and the GUI provided by TortoiseHg and I've decided I don't like TortoiseHg that much. But I also don't like leaving the command prompt open all the time just for an occasional repository action. And I also don't like Win+R -> cmd -> [series of commands that navigate to the repo directory].

What I'd really like is some easy way to open a directory I'm in (from Windows Explorer) in the command prompt. Whether it's a shell extension so right click -> "Open dir in cmd" or if it's in the SendTo -> Cmd or even I guess a hotkey (though I'd rather not run a little hotkey app the whole time just for this one little use case scenario).

I thought I saw something like this already on DC but I can't find it. So if it already exists, please help point me to it. If not, please someone take up the cause and code it! (c:

EDIT: Krishean made it super easy! (click the blue text below to quickly get to the download)

I took the liberty of compiling everything listed in the thread into one reg file (and one to reverse the changes)

features:
works on windows 7 (should work the same on both x86 and x64) dunno if it does anything on xp, may or may not work on vista
works with rightclicking on a blank area of the directory
works with rightclicking on a drive or directory
shift+rightclicking adds the additional option of "Open administrator command window here"
« Last Edit: June 21, 2010, 01:20:33 AM by Deozaan » Logged

AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #1 on: June 16, 2010, 02:22:07 PM »

Google

Open Command Prompt Here
Logged
rjbull
Charter Member
***
Posts: 2,778

View Profile Give some DonationCredits to this forum member
« Reply #2 on: June 16, 2010, 02:51:15 PM »

It's one of the features built into Listary, even the free-for-personal-use version.  But, it's another app to run and another hotkey, though you might like Listary's other features enough to run it anyway.  However, I suspect you're thinking of DOSHERE, mentioned in e.g. Feature Request - right click on results Command prompt here option.  As it's so small (just an INF file - don't ask me how to use it) I'll attach it to this post.

* doshere.zip (0.64 KB - downloaded 183 times.)
Logged
MilesAhead
Member
**
Posts: 4,969



View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: June 16, 2010, 04:56:22 PM »

http://www.favessoft.com/PromptHere.zip

It uses a hotkey rather than a context menu.  Should work on both 32 and 64 bit Windows.  At least it works for me in Vista64 and W7 32 bit.

edit: one thing different than most "command prompt here" type utilities is you can open more than one prompt.  Say you have \temp and \temp2 under C:.  Highlight them both and hit the hotkey.
You'll have a prompt for each with that folder as the current directory.

edit2: there's no unicode support. I provide source in case some may wish to investigate how to add unicode support to the program.  It's done in ahk.
« Last Edit: June 16, 2010, 05:00:47 PM by MilesAhead » Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Deozaan
Charter Member
***
Posts: 6,438



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: June 16, 2010, 05:27:45 PM »

Thanks for the help, everyone.

I found out from the comments in this blog (the blog itself wasn't very specific) that Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here

If you want it in XP, there's a Microsoft Windows XP PowerToy for that. (Direct Link to EXE)
Logged

daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: June 16, 2010, 05:57:12 PM »

In XP I used to add it to the context menu just a registry entry.
Logged
AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #6 on: June 16, 2010, 08:34:12 PM »

Thanks for the help, everyone.

I found out from the comments in this blog (the blog itself wasn't very specific) that Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here

I wasn't paying attention (still running XP), but one of the links I checked said something about a registry entry that would show "Open Command Window Here" even when the Shift key wasn't being held down.  If that's of any interest...
Logged
Deozaan
Charter Member
***
Posts: 6,438



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: June 17, 2010, 01:12:30 AM »

I wasn't paying attention (still running XP), but one of the links I checked said something about a registry entry that would show "Open Command Window Here" even when the Shift key wasn't being held down.  If that's of any interest...

That does interest me.

I found this one, which adds a "Run Command Prompt as Administrator Here":

[copy or print]
[netshelter][HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Administrator Command Prompt here"
"NoWorkingDirectory"=""
 
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /k \"pushd %L && title Command Prompt\""
 
[HKEY_CLASSES_ROOT\Drive\shell\runas]
@="Administrator Command Prompt here"
"NoWorkingDirectory"=""
 
[HKEY_CLASSES_ROOT\Drive\shell\runas\command]
@="cmd.exe /k \"pushd %L && title Command Prompt\""

Does anyone understand this stuff well enough to modify that so it doesn't use administrator privileges? I don't need the elevated privileges.

EDIT: I think I found the answer here, which basically says:

Rename or delete the "Extended" key for both "HKEY_CLASSES_ROOT\Drive\shell\cmd" and "HKEY_CLASSES_ROOT\Directory\shell\cmd" in the registry.

Just tested it and it works in Windows 7 (64-bit) though it should work both 32-bit and 64-bit versions (including Vista).

Thanks for pointing out this option, AndyM!
« Last Edit: June 17, 2010, 01:26:09 AM by Deozaan » Logged

rjbull
Charter Member
***
Posts: 2,778

View Profile Give some DonationCredits to this forum member
« Reply #8 on: June 17, 2010, 02:54:15 PM »

Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here

Just tried it, and it works on Vista Home Premium in a user account with UAC On.  But if you want a DOS prompt in the current directory, you'd have to go up a level then highlight the one you've just come from, because you don't get Open Command Window Here if you right-click on a file.
Logged
daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #9 on: June 17, 2010, 03:42:53 PM »

Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here

Just tried it, and it works on Vista Home Premium in a user account with UAC On.  But if you want a DOS prompt in the current directory, you'd have to go up a level then highlight the one you've just come from, because you don't get Open Command Window Here if you right-click on a file.

You can also Shift-Right Click on a blank space within the current folder
Logged
Deozaan
Charter Member
***
Posts: 6,438



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: June 17, 2010, 03:46:33 PM »

Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here

Just tried it, and it works on Vista Home Premium in a user account with UAC On.  But if you want a DOS prompt in the current directory, you'd have to go up a level then highlight the one you've just come from, because you don't get Open Command Window Here if you right-click on a file.

You can also Shift-Right Click on a blank space within the current folder

Any idea what registry setting that's under so I can remove the "Shift" requirement for it?

EDIT: Found it!

Navigate to "HKEY_CLASSES_ROOT\Directory\Background\shell\cmd" and rename or delete the "Extended" key.
« Last Edit: June 17, 2010, 03:49:00 PM by Deozaan » Logged

daddydave
Supporting Member
**
Posts: 818



see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #11 on: June 18, 2010, 11:50:48 AM »



Any idea what registry setting that's under so I can remove the "Shift" requirement for it?

EDIT: Found it!

Navigate to "HKEY_CLASSES_ROOT\Directory\Background\shell\cmd" and rename or delete the "Extended" key.

That gives me an idea to relegate a lot of context menu items I rarely need to that Shift key..wonder if it works in reverse.
Logged
AndyM
Charter Member
***
Posts: 616


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #12 on: June 18, 2010, 05:02:45 PM »

That gives me an idea to relegate a lot of context menu items I rarely need to that Shift key..wonder if it works in reverse.
You are hereby directed to research, experiment, and report back.  Grin
Logged
MilesAhead
Member
**
Posts: 4,969



View Profile WWW Give some DonationCredits to this forum member
« Reply #13 on: June 18, 2010, 05:39:54 PM »

This NirSoft utility might be useful for managing the context menu and extended context menu.  Haven't tried it yet myself though.

http://www.nirsoft.net/utils/shell_menu_view.html

Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
lanux128
Global Moderator
*****
Posts: 6,120



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: June 19, 2010, 12:25:45 AM »

This NirSoft utility might be useful for managing the context menu and extended context menu.  Haven't tried it yet myself though.

http://www.nirsoft.net/utils/shell_menu_view.html

+1 for this tool. been using it for some time. it was helpful in snuffing out the spam WMP installs in the context-menu for the media files.
Logged

rjbull
Charter Member
***
Posts: 2,778

View Profile Give some DonationCredits to this forum member
« Reply #15 on: June 19, 2010, 03:30:03 PM »

if you want a DOS prompt in the current directory, you'd have to go up a level then highlight the one you've just come from, because you don't get Open Command Window Here if you right-click on a file.

You can also Shift-Right Click on a blank space within the current folder

Yes, tried it, you're right.  Thanks!  smiley
Logged
Krishean
Honorary Member
**
Posts: 75



I like pie

View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: June 20, 2010, 07:56:30 PM »

I took the liberty of compiling everything listed in the thread into one reg file (and one to reverse the changes)

features:
works on windows 7 (should work the same on both x86 and x64) dunno if it does anything on xp, may or may not work on vista
works with rightclicking on a blank area of the directory
works with rightclicking on a drive or directory
shift+rightclicking adds the additional option of "Open administrator command window here"

* cmdhere.zip (0.86 KB - downloaded 227 times.)
Logged

Any sufficiently advanced technology is indistinguishable from magic.

- Arthur C. Clarke
Deozaan
Charter Member
***
Posts: 6,438



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: June 21, 2010, 01:17:07 AM »

I took the liberty of compiling everything listed in the thread into one reg file (and one to reverse the changes)

Awesome! Thanks! I'll update the original post to point to your download. Thmbsup

EDIT: Just tested both the reg and the "undo" and they work as advertised (Win7 64-bit). Thanks again!
« Last Edit: June 21, 2010, 01:24:06 AM by Deozaan » Logged

kyrathaba
N.A.N.Y. Organizer
Honorary Member
**
Posts: 3,013



while(! dead_horse){beat}

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: July 12, 2011, 07:09:38 PM »

Thanks for the help, everyone.

I found out from the comments in this blog (the blog itself wasn't very specific) that Windows 7 (and Vista) already has this built in by following these steps:

1. Select the directory so that it is highlighted
2. Hold Shift and Right Click the directory
3. Select Open Command Window Here


That is handy  thumbs up  Learned something new today cheesy
Logged

Win 7 Home Premium 64bit-SP1 AMD Athlon II X2 220 Socket AM3 (938) @ 2.1GHz 6GB RAM Firefox 26.0
_________________________________________________________________________________________

I'm fighting against patent trolls. Join me and tell your representative to support the #SHIELDAct: https://eff.org/r.b6JJ /via @EFF

My DC page: http://kyrathaba.dcmembers.com | My blog: http://williambryanmiller.com/ | Proofreading Service: http://bit.ly/1fQSqQP

MilesAhead
Member
**
Posts: 4,969



View Profile WWW Give some DonationCredits to this forum member
« Reply #19 on: July 12, 2011, 07:50:18 PM »

In XP I used to add it to the context menu just a registry entry.

PromptHere can be used on XP, Vista, and W7 both 32 and 64 bit. It doesn't use the Glass blur effect on XP.  The glass effect is optional.  Set UseGlass=0 in .ini file if you don't want it.  You can also hit the Mouse hotkey in a blank space in a folder to open the prompt in that folder.  No need to navigate up first.

Edit: I updated PromptHere so that it no longer uses a macro to get the path of the current folder. It gets the info directly from Windows:

http://www.donationcoder....22509.msg264038#msg264038

« Last Edit: October 05, 2011, 12:51:58 AM by MilesAhead » Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Hacnstein
Supporting Member
**
Posts: 4

View Profile Give some DonationCredits to this forum member
« Reply #20 on: April 06, 2012, 07:32:33 AM »

I like command bar explorer from
http://www.codeproject.co...mmand-Prompt-Explorer-Bar
I am not sure if it is for any OS past XP.  The source is there in C, any one up to updating it?  or doing a rewrite?
Logged
MilesAhead
Member
**
Posts: 4,969



View Profile WWW Give some DonationCredits to this forum member
« Reply #21 on: April 06, 2012, 06:36:55 PM »

btw I did see after playing around with the Windows Seven built in context menu function that you  can select multiple folders in the same explorer window, then Shift Right Click for "open command window here."  That function will open a prompt with each folder as current directory. I've started using that on W7 just to cut down on the number of hotkey apps I'm running.  Likewise using the mouse to click on New Folder in Explorer instead of running a hotkey.
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.053s | Server load: 0.15 ]