"As Administrator" not working with Start Menu

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
gunterotto
Junior Member
Junior Member
Posts: 17
Joined: 2012-05-29, 05:03 UTC

"As Administrator" not working with Start Menu

Post by *gunterotto »

I have always used the TC Start Menu to run some simple system checks, using the * to prefix batch files that run (for example) SFC and Powercfg, but re-direct the output to my log directory.

What used to work on my Surface Pro 4 (TC 9.12, Windows 10) no longer runs. For example, the .bat that calls Powercfg /batteryreport now gives me this error:

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

My architecture has not changed, 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 TC Start Menu entry does not have any parameters or start path, only this Command:

*C:\Users\xxxx\OneDrive\...\!CHECK_Battery.BAT

The .bat does nothing other than call powercfg, and then copies the log, but now I get an error. The same happens for a .bat that calls SFC, which also needs, but does not get, an elevated command. Any ideas? :?: :oops: :cry:
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

Try

Code: Select all

*%SystemRoot%\system32\cmd.exe
in the command field and your script in the parameters field.

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 »

I tried your suggestion without success, but this is interesting...

A cmd window opened but the script never ran (I have a Continue y/n prompt at start, no sign of it or anything else). The header reads "Administrator: C:\Windows\SysWOW64\cmd.exe".

But, if I right click the Windows icon and open Command Prompt (Admin), I get a cmd window with a header of "Administrator: Command Prompt". In this window, my script runs just fine. *scratches head*

As I mentioned earlier, my Start Menu commands used to work (for years), now they do not. There is now some kind of diff between the Admin cmd windows.
User avatar
Dalai
Power Member
Power Member
Posts: 9387
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

So you're using 32 bit TC on 64 bit Windows, which I assumed at first, but ignored due to your other posts stating that you're using TC 64 bit. In this case, TC starts a 32 bit CMD which is not the same one you get when started by Start > Run > cmd.exe.

You need to change the script to account for that, like so:

Code: Select all

setlocal
set powercfg=%SystemRoot%\system32\powercfg.exe
if exist %SystemRoot%\SysNative\powercfg.exe set powercfg=%SystemRoot%\SysNative\powercfg.exe

"%powercfg%" /batteryreport ...
endlocal
I wasn't able to make a button with %SystemRoot%\SysNative\cmd.exe work in conjunction with the asterisk in front of it.

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 »

Thank you Dalai! It works!

When I did the clean install of v1709, I pinned the wrong TC .exe to the taskbar, simple as that! I was blissfully unaware that the 64-bit version was not running, as I've not encountered other issues. Your troubleshooting skills far exceed my own. Thanks again. :D
Post Reply