Create File? message
-
When I open some text files in notepad++ it comes up with a message saying “xyz path does not exist. Create it?” is there any way to stop this as it seems pointless to me as nothing seems to happen if I click ‘yes’ or ‘no’.
-
@Nostra-Damus said in Create File? message:
is there any way to stop this
Don’t pass files that don’t exist to the notepad++ command line.
Or, if you are running it from the command line, and the path has a space in it, put it in quotes:
"c:\program files\Notepad++\notepad++.exe" "c:\path to file\with spaces\filename.txt"
If you are getting that error when you right click on an existing file, then please go to ?-menu’s Debug Info after you say “no” to the message, and copy/paste that debug info into your reply: it will help us debug if you have a Windows file association that isn’t properly quoting filenames.
as it seems pointless to me as nothing seems to happen if I click ‘yes’ or ‘no’.
If you say “No”, then “nothing” happens because you told it to not create the file. But something actually happens: it did what you said. Specifically, there are two circumstances: if you said “no”, and it was the only file on the command line, and you had no files still open in your session, then it will just open Notepad++ normally with a
new 1
file (the same as if you hadn’t supplied that path on the command line); if you said “no”, but you had other files on the command line that did exist, and/or you had a session with files which would normally be loaded, then those files would be opened, but the non-existent file wouldn’t have a tab (not even anew 1
tab).If you say “yes”, it creates a tab with that name, and if you type text and Save, it will use the path (assuming it was a valid path) as the default name, instead of prompting you to choose a directory/filename.
-
I usually just right-click on a file and select ‘open with notepad++’
Debug from after it has done this and I clicked on ‘no’ to ‘create ?’ message.:Notepad++ v8.7.8 (64-bit)
Build time : Mar 7 2025 - 20:39:25
Path : C:\Utils\Notepad++\notepad++.exe
Command Line : C:\Store\OpSys\Notes\activate (2).bat
Admin mode : OFF
Local Conf mode : ON
Cloud Config : OFF
Periodic Backup : OFF
Placeholders : OFF
Scintilla Rendering Mode : SC_TECHNOLOGY_DIRECTWRITE (1)
Multi-instance Mode : monoInst
File Status Auto-Detection : cdEnabledNew (for current file/tab only)
Dark Mode : ON
OS Name : Windows 11 Pro N (64-bit)
OS Version : Dev
OS Build : 27863.1000
Current ANSI codepage : 1252
Plugins :
mimeTools (3.1)
NppConverter (4.6)
NppExport (0.4) -
@Nostra-Damus said in Create File? message:
I usually just right-click on a file and select ‘open with notepad++’
Is it exactly Open with Notepad++, or is it actually Edit with Notepad++, or is it the Open With menu and chosing Notepad++?
I ask, because I am trying to figure out if you are using the default Shell Extension that comes when you install Notepad++, which make the right-click menu command Edit with Notepad++, or whether you are using a custom registry entry / file association; or, maybe at some point, you just picked Open With > Notepad++, which might (IIRC) shorten to Open with Notepad++ in the main RightClick menu in future instances (I forget the exact text in a situation like that).
Command Line : C:\Store\OpSys\Notes\activate (2).bat
Okay, your filename has a space in it. If you were using Edit with Notepad++ from the Shell Extension, it shouldn’t have a problem with the space. That makes me think you’re using a custom entry (either manual file association, or using the Open With menu)
If you right click and Open with Notepad++ on a file that has no spaces in the path, I am betting it wouldn’t give you the “Create File?” message.
Local Conf mode : ON
Okay, you didn’t do a normal installation, since you’re in portable mode. That means it’s probably not the Shell Extension, and thus probably explains the root cause of your problem: I am going to say that your file association / OpenWith is set up wrong.
Run
regedit.exe
and search fornotepad++.exe
. You will probably find one or more entry that has a command with the value something likeC:\Utils\Notepad++\notepad++.exe %1
. You should change the%1
to"%1"
(ie, with quotes around it), because Windows requires quotes around the filename if there are spaces anywhere in the path. After you’ve changed all instances of that, log out of Windows and log back in (which will force Windows to use the updated file associations), and I’m guessing that will solve your “Create File?” message issue. -
It is ‘Open with Notepad++’, it is a reg file I found that set it up, I don’t get an ‘Edit with Notepad++’ option.
The change from %1 to “%1” has fixed it, thanks.
I have been reading the shell extension stuff but don’t have a ‘contextMenu’ folder in the Notepad++ folder, is there anywhere I can download it from? I have got the latest portable version off github but it is not in that either. -
@Nostra-Damus said in Create File? message:
but don’t have a ‘contextMenu’ folder in the Notepad++ folder, is there anywhere I can download it from? I have got the latest portable version off github but it is not in that either.
The portable edition does not come with the Shell Extension DLL because the Shell Extension is by definition not portable (it gets registered with your OS; one of the primary points of portable editions of software is to keep them from making changes to your OS configuration and to keep themselves limited to whatever directory you happen to be running them from)
The only way I have ever tried getting the shell extension is to run the installer (unfortunately, the installer is not one of the ones where you can change the filename to
xyz.zip
and just browse it like a zipfile, so you cannot easily extract from the installer without running it). And you seem to want the portable, not the installed version. However, it should be noted: you can still use the installer, and give it your alternate install directory ofC:\Utils\Notepad++\
and you can chooseDon't use %AppData%
in the options on the last page of the installer:
However, if you don’t want to run the installer at all, the repo for the Shell Extension is publicaly visible at https://github.com/notepad-plus-plus/nppShell/ … its “releases” only seems to share the source code, not the built DLL, but if you go to the most recent GitHub Actions CI_Build (https://github.com/notepad-plus-plus/nppShell/actions/workflows/CI_build.yml) – click on the most recent (topmost) run in the main list: if it is recent enough, it should have some artifacts attached, and you could grab the 64-bit artifact (the one with x64 in the name). You can extract the DLL from that artifact zipfile, and then create
C:\Utils\Notepad++\contextMenu\
folder and put the extracted DLL there.But honestly, that’s a lot of work when really all you needed was to add the quotes to get
"%1"
in your existing registry entries. Since you’ve already confirmed that works, I’d probably recommend just sticking with that.