• batman42ca

    batman42ca - 2014-01-18

    I'm using notepad++ version 6.5.3 and I can't get the -openSession command line option to work, although I've been unable to find any example of it's proper usage, I would assume this should work:

    notepad++ -openSession \notepadplus\sessions\mysession.nps

    ... assuming I've saved the session in the indicated directory with the indicated name. When I do this I always get the default session.

    • Andreas Jonsson

      Andreas Jonsson - 2014-01-18

      This is due to the backslash at the beginning. It causes N++ to try to load C:\notepadplus\sessions\mysession.nps, which is probably not what you want. Try

      notepad++ -openSession notepadplus\sessions\mysession.nps
      Last edit: Andreas Jonsson 2014-01-18
      • Andreas Jonsson

        Andreas Jonsson - 2014-01-18

        This follows the way the cd command treats paths beginning with backslashes. If I stand in my home directory, c:\users\andreas, and type in "cd \windows", it will switch working directory to c:\windows, not c:\users\andreas\windows.

        • batman42ca

          batman42ca - 2014-01-18


          ... is exactly what I want (I also tried it that way and that's exactly where I placed my session file). Does the -openSession command work for you?

          • Andreas Jonsson

            Andreas Jonsson - 2014-01-19

            It does indeed work for me. What happens if you try to load the session from the menu (File->Load session)?

  • cchris

    cchris - 2014-01-18

    If you write
    type \notepadplus\sessions\mysession.nps

    what do you get? Perhaps N++ just can't find your file.


    • batman42ca

      batman42ca - 2014-01-18

      Unfortunately it's nothing as simple as a missing file or bad path. I've verified my file is where I say it is. When I issue the "type" command I see the contents of the session file.

  • batman42ca

    batman42ca - 2014-01-19

    I think I found the problem. There was something wrong with my DOS shell. I had been experimenting earlier with launching the DOS shell from notepad++ and I think that caused a problem. I manually opened a new DOS shell, and -openSesssion now works.

    Thanks for the help.

    Last edit: batman42ca 2014-01-19
  • Mario Sargac

    Mario Sargac - 2014-02-19

    I have the same problem, that's why I am not opening a new topic. I tried many ways of entering a path after -openSession switch, and verified that the file exists using "type" command, as suggested above. Still, only default "session.xml" is read and saved at the Notepad++ closing.

    The last path I've tried is this:
    c:\Utils\Notepad++\notepad++.exe -openSession c:\Utils\Notepad++\session2.xml

    ...and it doesn't work for me. Is there anything I can try, to make it work? (I am using Notepad++ 6.5.4, zipped and Windows 7 64-bit OS)

    Last edit: Mario Sargac 2014-02-19
  • cchris

    cchris - 2014-02-22

    Define a session extension in Settings -> Preferences -> MISC, AVOID stting .xml as the extension, and use files with that extension on the command line. Double-clicking will work too.


  • Mesmeric

    Mesmeric - 2014-03-03

    I'm not achieving what I want either with openSession...
    I want to launch notepad++ from the command line with a given session and nothing else, but it simply appends the new session contents it to the default Notepad++ session. I have even tried multi instance always on.
    Ideally I'd like two instances of Notepad++ open with different sessions running, but having only one session at a time open - just seeing its files - would also be workable.
    I'm not getting this behaviour at all, but I've found a junction of the notepad++ directories into another has enabled a 'copy' of notepad++ that can be chosen from...


  • cchris

    cchris - 2014-03-08

    First of all, disable remembering of the current sesion for next launch in Settings -> Preferences -> MISC when working with other sessions than default. This will relieve the appending problem.

    Also, if you check "Don't use %appdata%" on installing, or remove doLocalConf.xml from aside notepad++.exe, you may have two or more installs of N++ and they won't share the same session, as each one will have a session.xml in a different folder.


  • Mike

    Mike - 2014-03-11

    I've been playing with -openSession for a bit now with no luck.

    I want to set up multiple shortcuts to Notepad++ - each shortcut should open NPP with a different set of files loaded. (this is to facilitate my working on different projects that use different source files)

    The files to be loaded seem to want to be stored in session.xml. However there's only one of these files. Clearly I need a separate one for each shortcut that I am building.

    Trying to "point" to it using -openSession doesn't work.
    My shortcut's command line looks like this:

    "C:\Program Files (x86)\Notepad++\notepad++.exe" -openSession c:\source_folder1\session.xml

    However, that seems to open the session.xml file (for editing) rather than using it as a list of the files to open.

    Any ideas?


    THEVENOT Guy - 2014-03-14

    Hello Mike,

    As Cchris said in his post above, at the address :

    DON'T use the extension XML for SESSION files ! Of course, it's naturally opened in N++, as any other .XML file.

    As for me, I currently use the extension SES for my session files. So, in your DOS command window, type in :

    "C:\Program Files (x86)\Notepad++\notepad++.exe" -openSession c:\source_folder1\

    Everything should, then, be OK !!!




Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks