file:///folder opens CMD instead of explorer

  • Hi everyone,

    I often use the feature of Notepad++ to open local directories like C:\tmp by using file:///C:\tmp with a double click.

    So far so good.

    Because I want to get something like the former CMD-Here function I followed the description of Microsoft blog. Here you can get the registry files I used to implement it. After applying the registry changes a double click on file:///C:\tmp opens the CMD prompt instead of the explorer.

    Do you have any idea how I can get the CMD-Here function and double click on file:///C:\tmp opens the explorer?

    Even hints where I can ask this question are welcome.

    Kind Regards

  • @tho-gru

    So you want both functionalities available, explorer and cmd prompt, on a single link. You’ve indicated that double-click would/should do one, but how do you envision invoking the other functionality?

  • Hi Alan,

    I expressed it miss leading, sorry.

    I want to double click in notepad++ to open the directory in the explorer.

    On the other hand when I have the explorer opened I want to have the CMD-here function.

    But with my current registry file (which is based on the Microsoft blog) the default action of notepad++ for the file:… link changed from “open explorer” to “open CMD”.

    I want to have:

    1. double click in notepad++ on file:/… open the explorer
    2. CMD-here function in explorer itself

    Kind Regards

  • @tho-gru

    So what you’re really saying is that you messed up how the double-click works in Notepad++, so you want to know how to put it back the way it was.

    It really doesn’t have anything to do with Notepad++. Notepad++, when doubleclicking a link runs Windows’ association for file://, so you have to fix that outside of Notepad++.

    Creating a “Cmd prompt here” is really outside of scope for this forum.

  • @Alan-Kilborn said in file:///folder opens CMD instead of explorer:

    Creating a “Cmd prompt here” is really outside of scope for this forum.

    That may be. But I’m glad @tho-gru brought it up, because I had never seen that MS article, and didn’t know you could add submenus in the right-click context menu.

    I now have a Notepad++ Extras submenu, along with my normal Edit With Notepad++ for all files
    And that’s just cool!

    My path to notepad++.exe will be different than yours, and the icons I chose require NPP v8.0 or newer, but this is a registry export that will recreate the Notepad++ Extras submenu

    Windows Registry Editor Version 5.00
    "MUIVerb"="Open in New Instance"
    @="\"C:\\usr\\local\\apps\\notepad++\\notepad++.exe\" -multiInst -nosession \"%1\""
    "MUIVerb"="Open Folder As Workspace"
    @="\"C:\\usr\\local\\apps\\notepad++\\notepad++.exe\" -multiInst -nosession -openFoldersAsWorkspace \"%W\""
    "MUIVerb"="Open As Session"
    @="\"C:\\usr\\local\\apps\\notepad++\\notepad++.exe\" -openSession \"%1\""
    "MUIVerb"="Notepad++ Extras"
    @="Edit With Notepad++"
    @="\"C:\\usr\\local\\apps\\notepad++\\notepad++.exe\" \"%1\""

    (And to comment on @tho-gru’s misinformation: properly following the MS blog will not change the default action for file:///... links in Notepad++ or for double-clicking on a directory in Explorer. It only adds to Windows Explorer’s right-click context menu choices, not changing the default action. So something else must have gone wrong while doing things not described in that blog. But it’s not a Notepad++ problem, so @tho-gru will have to go elsewhere to figure out how the default association for directories got messed up on their system, and how to fix it.)

    edit to post: added my Edit with Notepad++ to the registry export

  • Hi @PeterJones, hi @Alan-Kilborn,

    Thanks for your feedback.

    I know that my question does not really match the forum themes. But here are some developers which are interested in helping each other.

    Can you recommend a forum or similar place (stackoverflow …) where I may be will get an answer?

    Thanks for your help.

    Kind Regards

  • @tho-gru said in file:///folder opens CMD instead of explorer:

    Can you recommend a forum or similar place (stackoverflow …) where I may be will get an answer?

    I’m not even really sure what the question is, but it could very well be that stackoverflow is an appropriate place.

  • Hello everyone,

    One solution to my problem is to replace all occurrences of open with command-exec in the registry file:

    Windows Registry Editor Version 5.00
    ; Command Prompt
    @="cmd.exe /s /k pushd \"%V\""
    @="cmd.exe /s /k pushd \"%V\""

    Now I have the enhanced context menu at the folder and a double click on file:///c:\tmp starts the windows file explorer.

    Remark: The items in the submenu are displayed by the lexical order (1. command-exec, 2. runas …).

    Thanks for you help.

    Kind Regards

Log in to reply