Buttonbar icon with %P%S does not always work on search result
Moderators: Hacker, petermad, Stefan2, white
Buttonbar icon with %P%S does not always work on search result
1. Serch files from Server, e.g. *.txt
2. Feed the searchresult to listbox
3. Try to open a resultfile for viewing/editing using buttonbar with %P%S in parameters
4. File can not be opened. Instead on UNC-filename \\192.168..... editor gets filename C:\192.168......
If edited by pressing F4, there is no problem
If search is done on the computers own drives, everything works ok. Searchlist problem exists only when search is done to a server.
When buttonbaricon is used to view/edit a server file directly from source or target directory, everything works fine.
See attached image when there was a file named \\192.168.0.90\Varasto\Adsl\IP-kamera\kamera.txt in searchlist
Image: https://ht23.dy.fi/julkinen/2024-12-27-210501.png
2. Feed the searchresult to listbox
3. Try to open a resultfile for viewing/editing using buttonbar with %P%S in parameters
4. File can not be opened. Instead on UNC-filename \\192.168..... editor gets filename C:\192.168......
If edited by pressing F4, there is no problem
If search is done on the computers own drives, everything works ok. Searchlist problem exists only when search is done to a server.
When buttonbaricon is used to view/edit a server file directly from source or target directory, everything works fine.
See attached image when there was a file named \\192.168.0.90\Varasto\Adsl\IP-kamera\kamera.txt in searchlist
Image: https://ht23.dy.fi/julkinen/2024-12-27-210501.png
Re: Buttonbar icon with %P%S does not always work on search result
forgot to mention TC version: TC 11.50 RC4 (x64)
Re: Buttonbar icon with %P%S does not always work on search result
I can confirm that when using %P%S (or %S or %R) in Search results on remote Server, then the first \ in the path is removed - so instead of passing \\Server\path\file TC passes: \Server\path\file
It Works OK when using %P%N (or %N)
This bug appears the first time in TC 11.50b3.
Probably due to this change:
It Works OK when using %P%N (or %N)
This bug appears the first time in TC 11.50b3.
Probably due to this change:
historty.txt wrote:20.10.24 Fixed: Button bar, start menu: Remove any leading backslashes from names in fields %O, %R, %S, e.g. from file system plugin names (32/64)
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
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
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Buttonbar icon with %P%S does not always work on search result
Confirmed.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Buttonbar icon with %P%S does not always work on search result
Confirmed fixed in TC 11.50 finalhistory.txt wrote:29.12.24 Fixed: Button bar, start menu: Do not remove any leading duplicate backslashes from names in fields %S, %P%O, %P%S etc., e.g. after searching in UNC path (32/64)

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
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
Re: Buttonbar icon with %P%S does not always work on search result
It's time to kill the SPAM post)))
Last edited by AntonyD on 2025-01-05, 13:34 UTC, edited 1 time in total.
#146217 personal license
Re: Buttonbar icon with %P%S does not always work on search result
Moderator message from: white » 2025-01-04, 10:49 UTC
Spam post removed.
Re: Buttonbar icon with %P%S does not always work on search result
I am experiencing a similar issue with v11.50 x64. I have a Start Menu entry that runs an AutoHotkey script. It has worked for months or years. With 11.50, I get an access error with %P%S but not with %P or %P%N.
For some reason, %P%S does not work when running a program that has its file properties set to run the program as administrator.
For some reason, %P%S does not work when running a program that has its file properties set to run the program as administrator.
Re: Buttonbar icon with %P%S does not always work on search result
Confirmed.For some reason, %P%S does not work when running a program that has its file properties set to run the program as administrator.
I tetsted with Notepad++.exe and %P%S - and if I set the properties for Notepad++.exe (Compatibility tab) to run as administrator, then I get a mixed language error message (I am running TC with English language):
The translation of the Danish part is: "The requested action requires administrator rights".---------------------------
Total Commander
---------------------------
File not found!
C:\Program Files\Notepad++\notepad++.exe
"Den handling, der blev anmodet om, kræver administratorrettigheder."
---------------------------
OK
---------------------------
If I prepend the command in the button with and asterisk - it works. The same if I run TC as administrator.
It also works (without the asterisk) if I use %P%N
But, I see the same behavior in TC 11.03 - so it is not a new thing
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
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
Re: Buttonbar icon with %P%S does not always work on search result
And when using TC 7.0 (in which %S was introduced).petermad wrote: 2025-01-04, 22:54 UTC But, I see the same behavior in TC 11.03 - so it is not a new thing
And when configuring TC to use Notepad++.exe as the editor and clicking the F4 Edit button when a file is selected.
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Buttonbar icon with %P%S does not always work on search result
2mikeyww
Please provide the exact command and exact parameters you used which worked with 11.03 but not with 11.50.
Please provide the exact command and exact parameters you used which worked with 11.03 but not with 11.50.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Buttonbar icon with %P%S does not always work on search result
2ghisler(Author)
Do you confirm the issues (like petermad and me) when running a program that has its file properties set to run the program as administrator?
Do you confirm the issues (like petermad and me) when running a program that has its file properties set to run the program as administrator?
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Buttonbar icon with %P%S does not always work on search result
2white
That's a different problem - mikeyww writes that it worked with older versions but not with 11.50.
The problem you describe happens because when using %S or any other multi-file command, TC switches from launching with ShellExecuteEx to launching with CreateProcess. The reason us that ShellExecuteEx only supports a very limited maximum command line length (8191 for current windows versions), while CreateProcess supports up to 32767 characters.
Unfortunately CreateProcess does not support launching with higher user rights. Put an asterisk * at the start of the command to force launching as administrator with ShellExecuteEx.
That's a different problem - mikeyww writes that it worked with older versions but not with 11.50.
The problem you describe happens because when using %S or any other multi-file command, TC switches from launching with ShellExecuteEx to launching with CreateProcess. The reason us that ShellExecuteEx only supports a very limited maximum command line length (8191 for current windows versions), while CreateProcess supports up to 32767 characters.
Unfortunately CreateProcess does not support launching with higher user rights. Put an asterisk * at the start of the command to force launching as administrator with ShellExecuteEx.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: Buttonbar icon with %P%S does not always work on search result
Perhaps, we'll see when he responds.ghisler(Author) wrote: 2025-01-05, 10:55 UTC 2white
That's a different problem - mikeyww writes that it worked with older versions but not with 11.50.
The asterisk doesn't work when configuring the editor in TC.ghisler(Author) wrote: 2025-01-05, 10:55 UTC Unfortunately CreateProcess does not support launching with higher user rights. Put an asterisk * at the start of the command to force launching as administrator with ShellExecuteEx.
Would it be possible, or a good idea, to try ShellExecuteEx when CreateProcess fails in this case?
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: Buttonbar icon with %P%S does not always work on search result
What does this have to do with parameter %S in this thread?The asterisk doesn't work when configuring the editor in TC.
Anyway, I could switch to ShellExecuteEx for the editor, but I fear that it would break a LOT of configurations because programs and parameters are passed to it in a different way than with CreateProcess.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com