1

What should I add to the following command (in shortcuts.xml) so that Notepad++ would open the containing folder and also select the current file?

<Command name="Open containing folder" Ctrl="no" Alt="no" Shift="no" Key="0">explorer $(CURRENT_DIRECTORY)</Command>

Thank you.

1
  • The following command opens the folder and selects the file. I'm still looking for a way to open the folder maximized. &quot;C:\Windows\Explorer.exe&quot; /select, &quot;$(FULL_CURRENT_PATH)&quot; Thanks.
    – Yaron
    Jul 1, 2014 at 18:38

2 Answers 2

1

I can find it in my Notepad++ v6.6.9. working out-of-the-box:

  1. Right-click tab of desired document.

  2. From context menu, select Open Containing Folder in Explorer.

    ▶ This command not only opens given folder, but also selects current file.
       In Notepad++ source code you can see that the menu command performs the same as yours:      explorer /select,$(FULL_CURRENT_PATH) so you do not need to add it by yourself.
       And you can also check similar question for the command line.

5
  • Thanks. I wanted to select the file. I use the following code: &quot;C:\Windows\nircmd.exe&quot; exec max &quot;C:\Windows\Explorer.exe&quot; /select, &quot;$(FULL_CURRENT_PATH)&quot;
    – Yaron
    Sep 27, 2014 at 0:29
  • @Yaron - You didn't test steps given in the asnwer, did you? My apologies for not explicitly stating the result of the command. Now you can find it in the edited answer (last paragraph).
    – miroxlav
    Sep 27, 2014 at 11:35
  • Thank you miroxlav. I appreciate your help. It's been a while since I posted this question, and I apologize for not elaborating a bit more. I use NP++ v6.4.5. More recent versions have some problems with RTL languages (e.g. Hebrew). I also wanted the window to open maximized, and hence the use of nircmd. If you have a better way, please let me know. I'd be grateful. nirsoft.net/utils/nircmd.html
    – Yaron
    Sep 28, 2014 at 13:44
  • @Yaron - I missed your point with maximized window, sorry for that. For such a purpose, nircmd does its job well.
    – miroxlav
    Sep 28, 2014 at 13:51
  • Thanks again. It's kind of you. I didn't mention the "maximized window" in the original question. You didn't miss it. :) I appreciate your help.
    – Yaron
    Sep 28, 2014 at 13:55
0

From https://vincent.re/en/open-containing-folder-in-notepad

To assign the command to a shortcut. Open %APPDATA%\Notepad++\shortcuts.xml with an editor. In the <Macros> tag add the following for Ctrl+Shift+O

<Macro name="Open Containing Folder in Explorer" Ctrl="yes" Alt="no" Shift="yes" Key="79"> 
 <Action type="2" message="0" wParam="41019" lParam="0" sParam="" /> 
</Macro>

So for example, my file will look like this after

<NotepadPlus>
    <InternalCommands />
    <Macros>
        <Macro …>…</Macro>
        <Macro name="Open Containing Folder in Explorer" Ctrl="yes" Alt="no" Shift="yes" Key="79"> 
            <Action type="2" message="0" wParam="41019" lParam="0" sParam="" /> 
        </Macro>        
    </Macros>
    <UserDefinedCommands>
        <Command…>…</Command>
    </UserDefinedCommands>
    <PluginCommands />
    <ScintillaKeys />
</NotepadPlus>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .