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?
"As Administrator" not working with Start Menu
Moderators: white, Hacker, petermad, Stefan2
- gunterotto
- Junior Member
- Posts: 17
- Joined: 2012-05-29, 05:03 UTC
Try in the command field and your script in the parameters field.
Regards
Dalai
Code: Select all
*%SystemRoot%\system32\cmd.exe
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- gunterotto
- Junior Member
- Posts: 17
- Joined: 2012-05-29, 05:03 UTC
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.
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.
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:
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
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
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
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64
Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
- gunterotto
- Junior Member
- Posts: 17
- Joined: 2012-05-29, 05:03 UTC