Changing Settings File Directly Notepad new Version Warn

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
I-Vladimir
Junior Member
Junior Member
Posts: 29
Joined: 2012-09-26, 15:18 UTC

Changing Settings File Directly Notepad new Version Warn

Post by *I-Vladimir »

When I open ini files directly, each Notepad window displays a yellow box at the top: A new version of Notepad is available. Launch.
Launch button switches Notepad to UWP version. I assume command line can be changed to use an app registered for ini extension or use txt extension if nothing registered for ini.
OS Version - Microsoft Windows [Version 10.0.22621.1702]
User avatar
Dalai
Power Member
Power Member
Posts: 9964
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: Changing Settings File Directly Notepad new Version Warn

Post by *Dalai »

This has nothing to do with file extensions, and it's not a bug either. TC calls %SystemRoot%\system32\notepad.exe. This is hardcoded and can't be changed. It has been discussed for many years that TC should call the editor set in its options instead. Until this is implemented one can a workaround. Put the following on a button or TC's start menu.
Command:

Code: Select all

cmd.exe
Parameters:

Code: Select all

/c "start "" "C:\your_favorite_editor.exe" "%%COMMANDER_INI%%" "%%COMMANDER_PATH%%\wcx_ftp.ini""
The execution via cmd.exe ensures that environment variables are expanded. This way it works properly even if the editor can't understand them.

An UWP app can also be used. There's a thread with some PowerShell code I posted how the necessary information can be determined to start the desired app.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
I-Vladimir
Junior Member
Junior Member
Posts: 29
Joined: 2012-09-26, 15:18 UTC

Re: Changing Settings File Directly Notepad new Version Warn

Post by *I-Vladimir »

That is what I got calling FindExecutable("wincmd.ini", "c:\Program Files\totalcmd\")
C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2304.26.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe
So WinAPI call returns UWP app exe name
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6973
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Re: Changing Settings File Directly Notepad new Version Warn

Post by *Horst.Epp »

I use NotePad Replacer from
https://www.binaryfortress.com/NotepadReplacer/
It replaces all calls to NotePad with any other editor, in my case PSPad.
This works with the hardcoded NotePad call in TC and from any other tool.
Windows 11 Home, Version 24H2 (OS Build 26100.4061)
TC 11.55 RC2 x64 / x86
Everything 1.5.0.1391a (x64), Everything Toolbar 1.5.2.0, Listary Pro 6.3.2.88
QAP 11.6.4.4 x64
User avatar
Flint
Power Member
Power Member
Posts: 3506
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Re: Changing Settings File Directly Notepad new Version Warn

Post by *Flint »

Dalai wrote: 2023-06-15, 18:01 UTCThe execution via cmd.exe ensures that environment variables are expanded. This way it works properly even if the editor can't understand them.
BTW, in TC 11 you can use %|COMMANDER_INI| to insert the actual value of the variable, withoug having to rely on the started program to expand it.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Changing Settings File Directly Notepad new Version Warn

Post by *ghisler(Author) »

This isn't a bug in Total Commander, I just call the standard notepad.exe here.
Author of Total Commander
https://www.ghisler.com
User avatar
beb
Power Member
Power Member
Posts: 580
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Changing Settings File Directly Notepad new Version Warn

Post by *beb »

Therefore I use custom commands (usercmd.ini) for that (to open ini(s) in the associated editor).

For instance:

for the main .ini:

Code: Select all

[em_ini_edit]
cmd=%commander_path%\wincmd.ini
for all the .ini(s) which are not related to plugins:

Code: Select all

[em_ini_edit_noplugs]
cmd=Powershell -ExecutionPolicy Bypass
param=gci "$env:commander_path" -filter *.ini|Where-Object {$_.Name -notmatch 'plug'}|foreach-Object -process {ii $_.fullname}
for all the .ini(s) which are related to plugins:

Code: Select all

[em_ini_edit_plugs]
cmd=Powershell -ExecutionPolicy Bypass
param=gci "$env:commander_path" -filter *.ini|Where-Object {$_.Name -match 'plug'}|foreach-Object -process {ii $_.fullname}
and so on
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10/15
Post Reply