starting npp++ via batchfile
(Win10 with npp32-7.8.9)
maybe I’m to much old school but I frequently use batchfiles (.cmd) to load some files into npp. But allthough the opening command call “C:\Program Files (x86)\Notepad++\notepad++.exe” %userprofile%\abc.txt is executed npp doesn’t open. If npp is already opened with this file or any other file(s) the identical call / batchfile opens abc.txt in npp. I tried timeout.exe /T 1 or things lkike that, but that all doesn’t work.
Not guaranteed, but i think it is a problem since npp 7.8.9.
Maybe there’s a lot of us “old schoolers” around. :-)
Every single time I start N++, it is through a batch file (or two, called in sequence – hey, I’m “special needs”, right?).
If I launch it from my taskbar icon, it is through a batch file.
Every time I Explorer right-click start N++, it is through a batch file.
Every time I have my compare utility or my version control software auto-launch N++, it is through a batch file.
And of course, these are all executing the same batch file(s).
These are whether or not I already have N++ running.
It makes no difference.
It always works.
It always opens the intended file (if launched where instructed to do so).
So…there is no “problem” with Notepad++ regarding this.
I don’t know that this is the problem for you, but I’m suspicious of the
callin your command line. It seems like it would be “okay”, but it doesn’t seem necessary anyway so I would try removing it as a first step.
thx to Alan, but that’s not the problem. I need the call using 32-Bit npp++. Otherwise batch-execution waits until i exit the “first” npp before continuing an try to open the next file.
BUt I have now detected that there is a problem with the “one-instance-mode”. If I change to multi-instance-mode all runs fine.
But then for each file there is a new notepad window. And this handling is worse the handling of multiple files in the one-instance-mode which i prefer.
I think it’s a bug (since 7.8.9 / 7.8.8), but i’m not able to describe or show logs to proof this statement. I’m not allowed to change my notepad version to a former one so I can’t check this.
I’m using 7.8.9 - Multi-Instance is set to default(mono-instance).
Using this batch file
@echo off start "D:\PortableApps\Npp\notepad++.exe" "d:\logit.txt"
seems to do what you want to be done. Starts npp if not started and loads file if not loaded.
At least I enterered event-Manager and found a lot of crash reports for notepad++.
Checking the details there are alwayn shows problems with the HexEditor - Plugin 0.9.5.0. After removing this dll from the plugin folder all works fine. So it seems that notepad++ 7.8.9 (32-Bit) is not working together with HexEditor.
Since I almost never use the HexEditor that doesn’t hurt.
thx for help and input
Ah, so it wasn’t call or start at all?
It was the HexEditor plugin.
Maybe that should be the first debug question with all problems, “Are you using the HexEditor plugin?” It seems to cause a good number of strange issues.