"Run as admin" by * in toolbar button command requires the full path

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: petermad, Stefan2, Hacker

Post Reply
Slavic
Senior Member
Senior Member
Posts: 300
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

"Run as admin" by * in toolbar button command requires the full path

Post by *Slavic »

When we add an icon to the toolbar, we can input the full path name for executable or only the exe name if this path is included to the PATH= variable. For example, powershell.exe is enough for the command of PS button. However, to run PS as administrator with asterisk, need to input the full name, in my case *C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

Adding the asterisk before the filename in the button command *powershell.exe results in error:
Windows cannot find '*powershell.exe'. Make sure you've typed the name correctly, then try again.
However, in the TC command line adding the asterisk works well, as expected.
Last edited by Slavic on 2026-02-27, 14:41 UTC, edited 1 time in total.
Desktop: Windows 11 Pro 25H2, TC 11.57. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Run as admin" by * in toolbar icon command requires the full path

Post by *ghisler(Author) »

NOT confirmed.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 2184
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: "Run as admin" by * in toolbar icon command requires the full path

Post by *AntonyD »

Confirmed
Image: https://i.ibb.co/Zzw87P4N/2026-02-27-141840.png

Code: Select all

TOTALCMD#BAR#DATA
*powershell.exe

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe,1


0
-1
put this button on a vertical bar for example and click on it)
#146217 personal license
User avatar
petermad
Power Member
Power Member
Posts: 17395
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: "Run as admin" by * in toolbar icon command requires the full path

Post by *petermad »

Confirmed that
*powershell.exe does not work in a button while *"%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe" does.

In the command line it work both with and without path.
License #524 1994
Danish TC Translator
TC 11.58 32+64bit on Windows XP 32bit & Windows 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1416b
TC 3.62 on Android 6, 13, 15 & 16
TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
Slavic
Senior Member
Senior Member
Posts: 300
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *Slavic »

Thanks to all who confirmed this report! I changed "icon" to "button" in a header for more clarity.
Desktop: Windows 11 Pro 25H2, TC 11.57. Mobile: Pixel 5a, Android 14, TC 3.60b4
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *ghisler(Author) »

Oh sorry, I thought you were talking about the new command line feature to start commands via *powershell or *cmd etc.

For the button it is on purpose, so people don't create "dangerous" buttons which execute a fake cmd.exe or powershell.exe from the current directory. This is documented in the help, on the page "Dialog box: Configuration - Change button bar":
Put an asterisk '*' in front of the name (full path required) to start it with administrative rights, or two '**' to start is as a different user (Windows 7 or newer).
I would prefer to keep it this way.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 2184
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *AntonyD »

I guess from the current discussion you might well conclude that any information in the help helps only as long as it coincides with
the user's logical thinking.
And there's a clear disharmony here now. IF I as an independent user - create my own buttons - then of course I realize - what files
I choose to execute.
And if these buttons are suddenly created by intruders FOR ME in some mystical way, it doesn't matter what executable files are selected, because they have already gained full access to my computer. Therefore, your current solution of requiring the full path is just a nuisance to the mindset of the common user, but not to the attacker.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *ghisler(Author) »

It's not about buttons created by intruders, it's about cmd.exe in the current directory instead of the system program executed as administrator.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 2184
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *AntonyD »

And why should this moment somehow prevent the user from creating buttons exactly the way they think is necessary?
If you really want to help them avoid making a wrong step, then such behavior should also apply to those buttons where,
without *, a command is described which by accident may turn out to be a call to a file that does exist in the current dir,
rather than the one intended by the user from the system %PATH% variable. ;)
So let's then make a rule that all commands must have the full path to the main executable file.
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *ghisler(Author) »

Sorry, no changes yet. I'm still checking whether I should replace *cmd with c:\windows\system32\cmd.exe automatically as I do in beta 2 in the command now, or if there is a better solution.
Author of Total Commander
https://www.ghisler.com
User avatar
AntonyD
Power Member
Power Member
Posts: 2184
Joined: 2006-11-04, 15:30 UTC
Location: Russian Federation

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *AntonyD »

But we have challenges not only with "cmd" - but also with a bunch of other executable files.
And there can't be any best solutions, because the user makes the buttons for themselves and for their own needs.
And if they specifically made it so that in the necessary folders there is a copy of some executable file, then nothing
should prevent them from creating a button with the command to call "*exe_file_from_cur_dir"
#146217 personal license
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 53149
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: "Run as admin" by * in toolbar button command requires the full path

Post by *ghisler(Author) »

OK, I still think it's better to keep it as it is now. This was a heavy decision back then, and I want to keep it this way.
You only need to enter the path once when creating the button, so it's less work than with the command line.

Moderator message from: ghisler(Author) » 2026-03-05, 08:00 UTC

Moved to will not be changed
Author of Total Commander
https://www.ghisler.com
Post Reply