Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to make a shortcut to notepad++ in my desktop so it always opens a new file instead of the last one edited?

    Help wanted · · · – – – · · ·
    5
    10
    2810
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • TyrantRC
      TyrantRC last edited by

      Tittle.

      I remember doing something similar with another program in the past, kinda like editing the target column in the properties of the shortcut

      “D:\Programs\Notepad++\notepad++.exe +newfile” or something like that

      Meta Chuh rinku singh 2 Replies Last reply Reply Quote 0
      • Terry R
        Terry R last edited by Terry R

        @TyrantRC said:

        +newfile” or something like that

        In Notepad++, click on the ? in the top menu , right side. There is the "Commandline Arguments’ sub menu which will show you the options available.

        -nosession is likely what you want.

        Terry

        TyrantRC 1 Reply Last reply Reply Quote 4
        • Meta Chuh
          Meta Chuh @TyrantRC last edited by Meta Chuh

          @TyrantRC

          important note:

          if you use the -nosessions switch, like "C:\Program Files (x86)\Notepad++\notepad++.exe" -nosession, you will lose all eventually created and unsaved tabs you had before.

          also using the -nosessions switch even just once, will permanently disable settings > preferences > backup > enable session snapshot and periodic backup, so you will not be able to close notepad++ without saving unsaved tabs.

          alternative:

          if you really never, ever need notepad++ to re-open any of your previous files, and you want it to always open with a new 1 tab:
          you can do that in your notepad++ settings, without any need for a special desktop shortcut.
          please go to settings > preferences > backup and disable remember current session for next launch.

          TyrantRC 1 Reply Last reply Reply Quote 5
          • rinku singh
            rinku singh @TyrantRC last edited by

            @TyrantRC said:

            I remember doing something similar with another program in the past, kinda like editing the target column in the properties of the shortcut

            “D:\Programs\Notepad++\notepad++.exe +newfile” or something like that

            create a .bat or .cmd file as “D:\Programs\Notepad++\notepad++.exe myfile.txt”
            and create a desktop shortcut from this file.
            there are many examples

            1 Reply Last reply Reply Quote 1
            • TyrantRC
              TyrantRC @Meta Chuh last edited by

              @Meta-Chuh This was very helpful since I don’t really wanna disable that feature, I just wanna open a a new file with one click from different shortcut of my usual one. I’m gonna make a custom batch like @gurikbal-singh said

              1 Reply Last reply Reply Quote 1
              • TyrantRC
                TyrantRC @Terry R last edited by

                @Terry-R Do you know if I can do something similar but without losing the session? something like opening the session plus a new file without saving it anywhere, just like when you press the “new” button, you don’t close your session but you kinda create a temporal file without any route unless you save it somewhere. I know you can just press the button, but somehow it’s always takes me like 3 seconds to do it and I do this often enough to be annoying.

                I tried adding the name of a file “new” as an argument, but it saves it as a file in the notepad++ directory, I just want something temporal that I can close off whenever I finish with the task at hand. I also know it doesn’t save it anywhere because if you check in file > open container folder, there is nothing there.

                Meta Chuh 1 Reply Last reply Reply Quote 0
                • Meta Chuh
                  Meta Chuh @TyrantRC last edited by Meta Chuh

                  @TyrantRC

                  if I can do something similar but without losing the session?

                  for your case, i would recommend to use the portable notepad++ version in addition to your installed notepad++ (like i do).

                  the portable version runs completely independent and isolated from your installed version, and all custom settings (as well as any stuff you might want to try at the portable version), will not modify anything on your installed version.

                  this way you have your full session enabled installed notepad++, plus an independent notepad++, which always opens a new 1 tab, without touching or deleting any sessions of your mainly used installed version.

                  guide:

                  • download the portable notepad++ version 7.6.4. from >>> here <<< and extract npp.7.6.4.bin.zip.

                  • create the folder structure C:\PortableApps\Notepad++\.

                  • copy all contents from npp.7.6.4.bin.zip to C:\PortableApps\Notepad++\.

                  • create a normal desktop shortcut icon, without any switches, for C:\PortableApps\Notepad++\notepad++.exe

                  • open up this portable notepad++ using your created shortcut.

                  • go to settings > preferences > backup at your portable notepad++, and disable remember current session for next launch.
                    (this will set the portable version to always open up with a new 1 tab.)

                  • go to settings > preferences > multi-instance at your portable notepad++, and set it to always in multi-instance mode
                    (this will allow you to use this portable notepad++, even if your installed notepad++ is already open. it will not interfere with any sessions or unsaved tabs, and you can have both open at the same time for e.g. comparison)

                  if your workflow is similar to mine, this dual independent notepad++ setup will be the most flexible, as we do not have to worry about any settings conflicting with each other, and we can also have different, isolated sets of plugins on each notepad++.

                  note: if you want, you can set a different colour theme for the portable notepad++ at settings > style configurator > select theme, to better distinguish which notepad++ is which.

                  Alan Kilborn TyrantRC 2 Replies Last reply Reply Quote 3
                  • Alan Kilborn
                    Alan Kilborn @Meta Chuh last edited by

                    @Meta-Chuh said:

                    this way you have your full session enabled installed notepad++, plus an independent notepad++, which always opens a new 1 tab,

                    I have not tried this technique, but a thought occurred to me that it would be interesting if both could be running at the same time. As I said, I haven’t tried that exact thing, but I have noticed in the past that if I wanted to run, say, Notepad++ 7.6.3 and Notepad++ 6.9 at the same time, it won’t do it, even if the versions are “portable” and totally independent. Note that I’ve only tried with “single instance” mode, if that makes sense (maybe it doesn’t). :)

                    1 Reply Last reply Reply Quote 1
                    • Alan Kilborn
                      Alan Kilborn last edited by

                      I just tried a couple of different “portable” versions using the -multiInst command-line option on each; worked fine so I can’t recall exactly why I had trouble with this in the past. Sometimes a question posted here prompts thinking about things long set in your mind, and a new solution to an old “problem” bubbles up. :)

                      1 Reply Last reply Reply Quote 3
                      • TyrantRC
                        TyrantRC @Meta Chuh last edited by

                        @Meta-Chuh that’s a very interesting approach, will try this, although I honestly don’t know why notepad++ doesn’t have any way to open a new temp file without losing a session on start up as most software you find.

                        1 Reply Last reply Reply Quote 1
                        • First post
                          Last post
                        Copyright © 2014 NodeBB Forums | Contributors