Notepad opbviously think is has to open a file named hosts.txt and not just named hosts - but for some reason only when run as admin.
It does not happen when TC is started in elevated mode, so the txt extension must be somthing the UAC adds to the parameter? - but why doesn't it happen when the path and filename is stated in the command line? (see: http://ghisler.ch/board/viewtopic.php?p=237889 )
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14 TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
UAC will never modify command line, it doesn't know what it starts.
Notepad may try to open hosts.txt file when just hosts passed as parameter, that's why TC appends a dot to filename w/o extension on Shift+F4.
Also, Notepad may not append a dot if full path is passed, or a file with exact name exists. So it seems that problem is in working path which Notepad just can't find.
If you look, Notepad has working path C:\Windows\System32 instead of C:\Windows\System32\drivers\etc when it is started as administrator. It seems that problem is that path C:\Windows\System32\drivers\etc is invalid for 32-bit application... But maybe Notepad is able to handle non-redirected path correctly when it is passed as parameter.
But if I use:
%systemroot%\notepad.exe (64bit)
%systemroot%\system32\notepad.exe (64bit)
%systemroot%\syswow64\notepad.exe (32bit)
as Command it doesn't work, like previously described.
There is a difference in the UAC dialog that pops up:
1. If I use %COMMANDER_PATH%\tools\notepad.exe the UAC dialog has a yellow background in the top part, and it says that the Publisher of notepad.exe is unknown.
2. If I use one of the 3 orginal notepad.exe's (fx. %systemroot%\notepad.exe), then there is a blue background in the top part of the UAC dialog, and is says that Microsoft Windows is the Approved Publisher of Notepad (not notepad.exe).
License #524 (1994)
Danish Total Commander Translator
TC 11.51 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1391a
TC 3.60b4 on Android 6, 13, 14 TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar