Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Open Command prompt here

2012-03-05
2013-06-12
  • Robert Morphis
    Robert Morphis
    2012-03-05

    I would like to use an existing console2 as the target for "open command prompt here", so that a new tab opens in the directory of interest.

    Basically I want to be able to open a tab for a given directory in a running console2 instance  from outside that instance.

    Is that currently possible?

    I imagine I will have to write some code to go through existing processes to find the pid of the running console2…

    Oh yeah,
    Thanks for the work, I frequently have three or four cmd windows open, and it is so much nicer to have them all in one place.

     
  • nexus
    nexus
    2012-03-31

    I use this .reg file

    [-HKEY_CLASSES_ROOT\Directory\shell\console2here]
    [HKEY_CLASSES_ROOT\Directory\shell\console2here]
    @="Open console here"
    "Icon"="C:\\develop\\conf\\etc\\cmd.ico"
    [-HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
    [HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
    @="\"C:\\develop\\dev\\console\\Console.exe\" -d \"%L\""
    
     
  • We have developed in a branch a version of Console 2 that you can start from the context menu.
    It add several small improvement like the possibilities to reuse existing tabs to avoid to have many console in the same working folder.
    You can find the experimental installer at: https://sourceforge.net/projects/console-devel/

    Best regards,
    Vivian.

     
  • Derell Licht
    Derell Licht
    2012-04-04

    nexussays: I tried importing your file, which was saved as open.here.reg
    I'm using Windows 7 64-bit.  I tried running it as Administrator and as User, but in both cases, Windows gave an error, saying:
    Cannot import file: the specified file is not a registry script. 

    What is missing here?? 

    Here's my actual file, containing valid paths to my targets:

    @="Open console here"
    "Icon"="C:\\icons\\colors.ico"

    @="\"C:\\utility\\console2\\Console.exe\" -d \"%L\""

     
  • nexus
    nexus
    2012-04-04

    gorlash, add this as the first line of your .reg file

    Windows Registry Editor Version 5.00
    
     
  • nexus
    nexus
    2012-04-04

    Apparently there is no way to edit posts… that rather ridiculous in 2012.

    Anyway, here is my exact reg file, literally copy/pasted instead of just highlighting the important bits as I did in my first post:

    Windows Registry Editor Version 5.00
    # elevated -- does not appear to work anymore
    [-HKEY_CLASSES_ROOT\Directory\shell\cmdadmin]
    #[HKEY_CLASSES_ROOT\Directory\shell\cmdadmin]
    #@="Open command window here"
    #"HasLUAShield"=""
    #"Icon"="C:\\Windows\\System32\\imageres.dll,-78"
    [-HKEY_CLASSES_ROOT\Directory\shell\cmdadmin\command]
    #[HKEY_CLASSES_ROOT\Directory\shell\cmdadmin\command]
    #@="cmd.exe /s /k pushd \"%V\""
    # console 2
    [-HKEY_CLASSES_ROOT\Directory\shell\console2here]
    [HKEY_CLASSES_ROOT\Directory\shell\console2here]
    @="Open console here"
    "Icon"="C:\\develop\\conf\\etc\\cmd.ico"
    [-HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
    [HKEY_CLASSES_ROOT\Directory\shell\console2here\command]
    @="\"C:\\develop\\bin\\console\\Console.exe\" -d \"%L\""
    # git bash using console2
    [-HKEY_CLASSES_ROOT\Directory\shell\gitbashhere]
    [HKEY_CLASSES_ROOT\Directory\shell\gitbashhere]
    @="Open git bash here"
    "Icon"="C:\\develop\\conf\\etc\\git.ico"
    [-HKEY_CLASSES_ROOT\Directory\shell\gitbashhere\command]
    [HKEY_CLASSES_ROOT\Directory\shell\gitbashhere\command]
    @="\"C:\\develop\\bin\\console\\Console.exe\" -t \"Git Bash\" -d \"%1\""
    
     
  • Derell Licht
    Derell Licht
    2012-04-05

    Okay, I haven't tried your complete script yet, I just added the line from message 5 above, and that *does* make the registry file install correctly.  However, it doesn't quite do what the OP requested (and what I want)… if I already have Console2 open, using this explorer link should open a new tab in the existing Console2 instance, but it does not.  Instead, it opens another instance of Console2, using the targeted directory.

    I'll try your complete script from message 6 and see what happens.  This is going to take some effort, because unfortunately when I copy from here (Firefox 11) and paste into notepad, all the end-of-line characters are lost, and the entire program comes out on one line!!  What a pain!

     
  • Derell Licht
    Derell Licht
    2012-04-05

    (Yes, I also wish I could edit existing posts…)

    Okay, your complete script works the same way; is there a way to open the tab in an existing Console2 session?