Menu

Open one document only

LouArnold
2011-09-07
2012-11-13
  • LouArnold

    LouArnold - 2011-09-07

    Is there a setting that limits Notepad++ to open only the current or a new document?

    I want to right -click a document and open only it , and not any past documents.
    I also want to open Notepad++ and have a new blank document there.

     
  • Vera

    Vera - 2011-09-07

    Menu\Settings\Preferences -> Tab:MISC

    uncheck : Remember the current session for next launch

    with this (new) setting NPP may automatically come up with an empty document when it's started directly (can't check right now)

     
  • Marc Kupper

    Marc Kupper - 2011-09-07

    In the registry go to HKEY_CLASSES_ROOT\Applications\notepad++.exe\shell\open\command

    You will see a line that looks like (default) "C:\Program Files\Notepad++\notepad++.exe" "%1"

    Change that to "C:\Program Files\Notepad++\notepad++.exe" -nosession -multiInst "%1"

    That fixes double clicking to open a file and right click and selecting "open"

    If you want to fix right-click "Edit with Notepad++" then first go to HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\Notepad++  I believe you will see the default value is {00F3C2EC-A6EE-11DE-A03A-EF8F55D89593}

    Go to HKEY_CLASSES_ROOT\CLSID\{00F3C2EC-A6EE-11DE-A03A-EF8F55D89593}\Settings. Among the items should be Custom REG_SZ and nothing after it. Change that the value of that to "-nosession -multiInst" so that it reads "Custom REG_SZ -nosession -multiInst" (both without the quotes). If you already have custom arguments defined then just add space and append "-nosession -multiInst" to the list.

     
  • Marc Kupper

    Marc Kupper - 2011-09-07

    I should explain my previous reply a bit.

    -nosession will cause Notepad++ to not load the default session on startup. Sessions are the list of files in a tab. -nosession also prevents Notepad++ from saving the session state on exit.

    -multiInst causes a new instance of Notepad++ to be run rather than adding a file you want to open/edit as a new tab to a current instance of Notepad++. 

     
  • LouArnold

    LouArnold - 2011-09-08

    The change in "Settings" did the trick. I took a copy of the description of registry changes in case I need them. An interesting text editor this is. So far it seems my changing to it was a wise move.

     
MongoDB Logo MongoDB