How do I run tc apps as admin from the Startmenu?

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

How do I run tc apps as admin from the Startmenu?

Post by *brian »

In the start menu, there's an option for running an editor like Notepad or NPP++ but with a file so that it opens that text file, but with that editor.

Now, how do I do that, while running the editor As An Administrator?

My goal is to edit the hosts file, and the only way to do that is to Run As An Administrator, but when I do that via the Start menu in the normal way, it's not Ran As An Administrator ...
User avatar
Dalai
Power Member
Power Member
Posts: 9365
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Prefix the command field with an asterisk (*), so you get for example

Code: Select all

*notepad++.exe
This works in TC's starter menu and on the button bar. On the latter, you can also right-click any button (that doesn't use a cm_ command) and select "As Administrator".

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
brian
Junior Member
Junior Member
Posts: 61
Joined: 2003-09-25, 01:14 UTC
Contact:

it kinda worked but

Post by *brian »

Caveats:

1.
So, it turns out that the asterisk needs to be in front of the full path not just the filename, which might be obvious to you but it wasn't immediately obvious to me:

So:
*C\Windows\notepad.exe
not
C\Windows\*notepad.exe

2.
If I use the same thing on the button (*C\Windows\notepad.exe, but not
not C\Windows\notepad.exe) , I don't need to right-click and select "As Administrator".
This is the fastest way of doing it, but it'll take space on the toolbar.

3.
Not sure if the two asterisks, above the 8 and on the NumBlock will both do the trick

In general, thanks, it worked.
User avatar
Dalai
Power Member
Power Member
Posts: 9365
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Re: it kinda worked but

Post by *Dalai »

brian wrote:So, it turns out that the asterisk needs to be in front of the full path not just the filename [...]
That's why I wrote "prefix the command line". The whole thing is also described in TC's help, in the section that is opened when pressing F1 in the appropriate dialog/window. Unfortunately, Ghisler forgot to add this to the help section describing the TC start menu...
If I use the same thing on the button (*C\Windows\notepad.exe, but not
not C\Windows\notepad.exe) , I don't need to right-click and select "As Administrator".
Yes, I forgot to mention that.
Not sure if the two asterisks, above the 8 and on the NumBlock will both do the trick
If you're not sure that both keys (or key combinations) will result in the same character: they do.

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
serjayes
Junior Member
Junior Member
Posts: 56
Joined: 2004-01-19, 16:53 UTC

Post by *serjayes »

Thanks Dalai for answering that the * marks the command to be run as an admin, I've never tried that for the command parameter of the start menu just not expecting that it's possible. Very convenient.
(user licence #64081)
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

brian wrote:it turns out that the asterisk needs to be in front of the full path not just the filename
*C\Windows\notepad.exe
Dalai wrote:Unfortunately, Ghisler forgot to add this to the help section describing the TC start menu...
Yes, it seems that this important information is missing in a Help file.

It's interesting that "As Administrator" menu is available for short commands (without path) like cmd, control or explorer.

However, TC won't start control/control.exe and explorer/explorer.exe as Administrator either using the asterisk and full path to their executables or this "As Administrator" context menu item (can be checked by starting a %COMSPEC% from Explorer's address bar). This is also true for RunDll32.exe shell32.dll,Control_RunDLL command, even with full path. Since the elavated cmd.exe also won't start mentioned commands as Administrator, it seems that it should be a normal behaviour.

If anyone still need to start Explorer command as Administrator, some parameter to explorer or explorer.exe (with full path if * used) must be added, like /n or , (also on Windows 7 and newer user has to enable the possibility to start the Explorer as Administrator using Registry). To start elevated Control panel, the command [*%windir%\system32\]explorer.exe ::{21ec2020-3aea-1069-a2dd-08002b30309d} may be used.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
gunterotto
Junior Member
Junior Member
Posts: 17
Joined: 2012-05-29, 05:03 UTC

Post by *gunterotto »

Have these simple rules changed since TC 9.1 and/or W10 Fall Creators Update? I have a simple batch file (that used to work) which basically does Powercfg /batteryreport and moves the log file for me. I now get this error when I call the .bat from Start Menu with an *:

The Power Efficiency Diagnostic library (energy.dll) could not be loaded.
The system cannot find the file specified.

The batch file works fine when run via CMD (Admin) but, as I said, it used to work via TC Start Menu. Not anymore. I also have another batch file which does SFC /scannow and moves the log file; it also used to work and does not anymore. Ideas? Thx.
User avatar
Dalai
Power Member
Power Member
Posts: 9365
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

2gunterotto
How exactly does your button/start menu entry look like? Which Windows and TC do you use exactly (architecture)?

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
gunterotto
Junior Member
Junior Member
Posts: 17
Joined: 2012-05-29, 05:03 UTC

Post by *gunterotto »

Dalai wrote:2gunterotto
How exactly does your button/start menu entry look like? Which Windows and TC do you use exactly (architecture)?
Thanks for the quick response! My architecture has not changed (Surface Pro 4, 64-bit TC, Windows 10), other than updating to the Fall Creators Update (in Dec) and to TC 9.12 (also Dec). One of those two updates likely caused what used to work, to not work anymore.

The .bat file is a simple run of Powercfg, ditto for SFC. The TC Start Menu entry does not have any parameters or start path, only this Command:

*C:\Users\xxxx\OneDrive\zzzzzzzz\yyyyyy\!CHECK_System_Files.BAT
Post Reply