Create file and open with Notepad++ fails
Moderators: Hacker, petermad, Stefan2, white
-
- New Member
- Posts: 1
- Joined: 2023-08-01, 23:04 UTC
Create file and open with Notepad++ fails
Hello. I use totalcmd 11 (just updated) and here is the problem:
If I create a file without extensions then it is failed to open as the dot added to the end of path.
For example I create file (Shoft+F4) "C:\123321" and then notepad is called like "C:\Program Files\Notepad++\notepad++.exe" "%1", it says "Cannot open file "c:\123321." <--- dot is added to the end of path.
This problem exists in 10.52 which I was using till now, was hoping that v11 has this issue fixed.
If I create a file without extensions then it is failed to open as the dot added to the end of path.
For example I create file (Shoft+F4) "C:\123321" and then notepad is called like "C:\Program Files\Notepad++\notepad++.exe" "%1", it says "Cannot open file "c:\123321." <--- dot is added to the end of path.
This problem exists in 10.52 which I was using till now, was hoping that v11 has this issue fixed.
Re: Create file and open fails
This is a known notepad++ bug NOT a TC bug.
(Search the forum for more infos)
(Search the forum for more infos)
Hoecker sie sind raus!
Re: Create file and open fails
This is a Tc bug. The bug is the wrong decision to simply append a dot to such a file name beyond the user. (Please search the forum for the reasons for this decision.) If one can understand the reasons for this decision by ghisler(author), so it is at least a bug not to let the user choose (via an ini switch) whether he wants the attached dot or not. But simply adding a dot does not respect the user. Not letting the users decide this is a bug and should be corrected before the release of Tc11.
Joube
Joube
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Create file and open with Notepad++ fails
The reason is that most versions of notepad.exe will try to open "filename.txt" instead of "filename" when just passing the name without dot at the end. Normally Windows does NOT allow to create files with a dot at the end, you need to use a special hack to access them at all. If you just pass "c:\path\filename." to the Windows functions, they will access "c:\path\filename" instead.
I will add a workaround when the path to the editor contain notepad++.exe. It will not work when you replace the actual executable notepad.exe with notepad++.exe or use something like choice editor, because then I cannot know that notepad++ will be called in the end.
I will add a workaround when the path to the editor contain notepad++.exe. It will not work when you replace the actual executable notepad.exe with notepad++.exe or use something like choice editor, because then I cannot know that notepad++ will be called in the end.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Create file and open with Notepad++ fails
I would not add a special hack to circumvent this error in Notepad++.
All other editors I tried work correct for this case.
User which insists to Notepad++ can still change the file name after editing.
All other editors I tried work correct for this case.
User which insists to Notepad++ can still change the file name after editing.
Windows 11 Home, Version 24H2 (OS Build 26100.3915)
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
TC 11.51 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.2.1 x64
Re: Create file and open with Notepad++ fails
It's a regression bug in Notepad++ and a fix is already committed. It should be fixed when the next version (8.5.5) is released.
Re: Create file and open with Notepad++ fails
ghisler(Author) wrote: 2023-08-02, 07:25 UTC The reason is that most versions of notepad.exe will try to open "filename.txt" instead of "filename"
I will add a workaround when the path to the editor contain notepad++.exe.
How about adding your trailing dot then only when the path to the editor (set by user or the default) contain "notepad.exe" ?
And ini-entries to let the user control such hacks are always welcome

Re: Create file and open with Notepad++ fails
Everybody, who have posted in this thread, know that.ghisler(Author) wrote: 2023-08-02, 07:25 UTC The reason is that most versions of notepad.exe will try to open "filename.txt" instead of "filename" when just passing the name without dot at the end. Normally Windows does NOT allow to create files with a dot at the end, you need to use a special hack to access them at all. If you just pass "c:\path\filename." to the Windows functions, they will access "c:\path\filename" instead.
Please do not supplement a bad automatism with another bad automatism. You ghisler(author) had received the wrong advice on this matter and got involved. Please rebuild this. Instead of putting another on it....ghisler(Author) wrote: 2023-08-02, 07:25 UTC I will add a workaround when the path to the editor contain notepad++.exe. It will not work when you replace the actual executable notepad.exe with notepad++.exe or use something like choice editor, because then I cannot know that notepad++ will be called in the end.
notepad++ works fine and correct (without any changes). So Tc had to make a special switch for all the editors out there, who wants to append .txt if not extension is handed over by the TC. No automatism. a configurable switch.
Joube
Last edited by JOUBE on 2023-08-02, 09:23 UTC, edited 2 times in total.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Create file and open with Notepad++ fails
That would break other editors. For example, I'm using OpenFileTC.exe, which then launches notepad.exe for some file types. There are other similar tools:How about adding your trailing dot then only when the path to the editor (set by user or the default) contain "notepad.exe" ?
Total Commander Edit Redirector
ChoiceEditor
ChooseEditor
Since only notepad++ is affected, it's better to just exclude it for that.
No it doesn't. Why would they announce a patch if it does?notepad++ works fine and correct (without any changes).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Create file and open with Notepad++ fails
Why? it is easy: It takes half a year before the author of notepad++.exe understand tc-forum-user 'white*s suggestion. After that, he told, he will implement this special feature, but after that, he releases a new version without a change at this point. So, to be clear, if Tc wants to speak with notepad++.exe, Tc has to handle it. And is able to do that very easy: by automatism, if there is no other way before the release of TC11.
Joube
Re: Create file and open with Notepad++ fails
You didn't respond to my question in another thread where I asked what version you are talking about:JOUBE wrote: 2023-08-02, 09:28 UTC Why? it is easy: It takes half a year before the author of notepad++.exe understand tc-forum-user 'white*s suggestion. After that, he told, he will implement this special feature, but after that, he releases a new version without a change at this point.
You say that there was an update of Notepad++ on July 17, 2023, but according to the website the latest version is 8.5.4 released on June 18, 2023. Please explain.white wrote: 2023-07-18, 19:47 UTCNew update? Where can I find it? The latest version I see is version 8.5.4.
I reported the bug, but it isn't my fix. If I understand it correctly the fix was committed 3 days ago, but I don't see a new version yet. So, no idea if the fix works.
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Create file and open with Notepad++ fails
2white
I have added this fix to Total Commander 11 now. Could you please check the pre-release version which I sent you via e-mail? That would help me a lot because there will be no more beta versions before the final release.
I have added this fix to Total Commander 11 now. Could you please check the pre-release version which I sent you via e-mail? That would help me a lot because there will be no more beta versions before the final release.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Create file and open with Notepad++ fails
I tested TC 32-bit and 64-bit with Notepad++ 64-bit. It works as long as you use full path to the editor including ".exe".ghisler(Author) wrote: 2023-08-02, 11:27 UTC 2white
I have added this fix to Total Commander 11 now. Could you please check the pre-release version which I sent you via e-mail?
It does not work when:
- You leave out ".exe"
- You leave out the path and the path is in the path environment variable
- You leave out the path and the full path is stored in the registry key
"HKEY_LM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\notepad++.exe"
(recent Notepad++ installers do that)
- ghisler(Author)
- Site Admin
- Posts: 50386
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Create file and open with Notepad++ fails
Yes, I'm aware of that. Since it's a workaround, I wanted to make it as restrictive as possible.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Create file and open with Notepad++ fails
It should also be possible with this pathname: "C:\Program Files (x86)\Npp\notepad++.exe". Does it?ghisler(Author) wrote: 2023-08-02, 12:59 UTC Yes, I'm aware of that. Since it's a workaround, I wanted to make it as restrictive as possible.
And in the 11 a should not only stay with the workaround, if possible.
The thread at notepad++ is pretty embarrassing overall. Denouncing a bug, it's the Tc itself manipulating user input.
2white
Incidentally, I simply installed the update that was automatically offered to me in notepad++ on that day mentioned. I use notepad++ every day. It was tow days after that post in that thread at notepad++.
Joube