Notepad++ one instance per each virtual desktop

8

I have problem with opening .txt file on windows-10. Notepad++ is default program to open .txt files, but when there is notepad++ application already running in other virtual desktop OS will automatically switch me to that other application instance and open file in other desktop. I want to open new instance of notepad++ in my current desktop. Is there a way to accomplish that?

[EDIT] Multi-Instance is one suggested solution, but this is bad in way that you loose tab functionality. I don't want my taskbar clogged with n++ processes.

One n++ for all desktops - this is killing the purpose of using multiple desktops in first place - keep different work processes and task separated.

watbywbarif

Posted 2016-05-09T12:42:07.260

Reputation: 590

1The virtual desktop feature within Windows does not work in this way, a single process is still going to exist, accross all desktops. In other words it does not work the way you believe it shoudl work. – Ramhound – 2016-05-09T12:48:51.180

1

you could try to open in multiple instance mode, here a little hint Notepad++ always in multi instance - if somehow defeats the tab functionality - but it could accomplish what you want to achieve...

– Zina – 2016-05-09T13:06:31.467

1@Ramhound I understand that W10 VD works this way, but this way sucks big time and I wan't to hack it. – watbywbarif – 2016-05-10T06:18:22.220

@Zina Yea, I don't wanna loose tab functionality. It works almost OK if I use: Multi-Instance: "Open session in a new instance of Notepad++" and then open new app in each desktop where i plan to use npp. As it is pinned to taskbar it is not bad, but still not perfect solution. – watbywbarif – 2016-05-10T06:40:46.193

OK, this last works at random or it changed with some patch. W10 virtual desktops are very unreliable help. – watbywbarif – 2016-05-31T05:58:01.943

What about having the same Notepad++ present across all desktops? – miroxlav – 2017-09-03T21:58:03.983

This is better than nothing, but this kind of behavior is opposite of why you use virtual desktops in first place. – watbywbarif – 2017-09-04T06:24:38.767

2You were offered two solutions so far. Please [edit] the question and extend it by details what exact behavior do you expect and what is the problem with solutions offered in comments. Then maybe I will retract my downvote, but currently I need to put it, because the question is unclear. – miroxlav – 2017-09-06T22:19:14.333

I don't think so, and ive explained why all suggestion are partial solutions. Maybe win10 virtual desktop model is broken, and app devs are not to blame. I wan't one n++ proc per desktops where new files are opened in new tab in the same desktop, flip flop between desktops sucks. – watbywbarif – 2017-09-15T08:04:35.970

Keep the process per desktop and drag instead of double click to open the file? – Seth – 2017-09-15T08:20:29.633

Are you fine with some preparation work upon opening new desktop? (Please use @miroxlav in your comments so I can see when you answer. Thanks.) – miroxlav – 2017-09-15T11:00:25.867

@miroxlav Yes, especially if it can be scripted like some batch. – watbywbarif – 2017-09-15T13:52:56.840

@Seth I am doing something like this most of the time. And it is tiresome. Drag, or File -> Open. – watbywbarif – 2017-09-15T13:54:23.240

Answers

2

Here is the hack that may work for you.

Requirements:

  1. Two Portable Notepad++ in two separate folders. (It may work with one NPP installation, but two separate Notepad++ seem to be cleaner approach. You may also not need Portable Notepad++, but it may be easier that way.)
  2. Two or more virtual desktops

How does it work: (I have animated GIF at the end to demonstrate this steps).

  1. Open Notepad++ folder on the first Virtual Desktop.
  2. Right click on Notepad++.exe to create a shortcut.
  3. Right click on the newly created shortcut and go to its properties.
  4. Add -multiInst in the target section. (The text is case-sensitive, and there is a space at the beginning.)
  5. Click OK to close the properties.
  6. Double click on the shortcut.
  7. It should open the new instance of Notepad++ in that virtual desktop.
  8. Now switch to another Virtual Desktop. Open its own Notepad++ folder. And follow steps 2-7.
  9. To keep things organized, I kept two folders, VM1 and VM2 with the notepad++ folders in them. (VM being Virtual Machine)

Some Final Notes:

  • This would work as long as the Notepad++ window in a virtual machine was Active, i.e. you had touched it at least once.
  • This is because when you open text file (or your source code files), it opens in the Last Active instance of Notepad++.
  • I am assuming that you are not changing your virtual desktops very frequently, since that would nullify the actual purpose of virtual desktops.

Here is the animated GIF.

  • You can right click on GIF and open it in new tab to see the steps clearly.
  • GIF shows steps on one virtual desktop, you need to replicate it on the other too.

    enter image description here

I hope it is helpful. Thanks.

Cricrazy

Posted 2016-05-09T12:42:07.260

Reputation: 826

Super detailed answer, will try and see how it works. "Last Active instance" part is a little downer, but i hope I can adapt. – watbywbarif – 2018-09-05T07:59:14.000

Yup. It is a kind of little downer. BTW your question and the approach is pretty interesting. I have not used Virtual Desktop as much as I should. I may try this. – Cricrazy – 2018-09-05T16:00:12.853

+1 Great, thanks! Now I can use npp without the "auto desktop switch" that was driving me crazy – Zack – 2019-04-24T13:50:22.607