What's new

Automated battery reports

nipponham

Active Member
I wrote some simple batch files that will automate the command to generate the following:
・Sleep study
・Battery report
・Battery energy status

Just unzip the contents of the file to a folder and click on the appropriate BAT file to generate the report to your desktop. If you want the files to be generated in a specific folder, you can edit the BAT file using notepad and add in the appropriate path. You will probably need to right click and run the files as administrator.

If you want a simple one-click solution, make a short cut of the batch file and then right click to open properties. From there, click on advanced settings and you will see an option to open the file as administrator. With that done, you can rename the shortcut, give it an icon and pin it to the Start page like this:


Just click the tile and your report will be waiting for you:)
(While the other reports are instantaneous, the battery energy status will take about a minute to generate.)
 

Attachments

  • BAT files.zip
    693 bytes · Views: 602
Last edited:
Thanks. These BAT files works great.

One thing you should bold and CAPITALIZE in the OP is the

"RUN AS ADMINISTRATOR"

part.

Thanks again. I really love seeing how my battery has only lost 2% of its total charge capacity after 1 month of ownership. Not too shabby!

Lastly, for some reason the ahortcut I created has the "run as administrator" greyed out in the properties menu. Any ideas how to fix this?
 
Last edited:
It sounds like your UAC is disabled. Go into user account settings through the control panel and check to see that this option is checked.
 
I was about to ask if anyone knows of an app that can do this. Now this BAT file seems to fit the need. Thanks OP/.
 
Lol, I despise UAC so much, that I will just manually run the Sleep Status and Battery Energy Report myself. I refuse to ever turn on UAC. It's like the plague.

Luckily, Battery Report does not need to be run as admin, and is the only report I will probably run weekly. The other 2 maybe monthly.
 
Ok I like the idea of a live tile that does that

Can You give us a step by step of how to do it , don't even know what a BAT file is
 
A BAT file is a simple script that automates commands so you don’t have to enter them manually every time you want to run it.

To make the tile, just follow the instruction in my OP. Once you have the shortcut made with administrator’s rights associated with it, just pin it to your Start page like you would with any other app. If you haven’t already, download and run this utility which will allow you to pin whatever you want. Right click on the shortcut you just made and you will see a shell command to pin/unpin. And that’s that. You’ve just made a tile.

Now the tile will have the default batch file icon on it, but you can change it to whatever you want. Right click on the short cut and click on properties. Near the bottom there will be a button to change icons. You can choose from a bunch of default Windows icons, browse the internet like I did to find different icons (i.e. ICO files), or choose whatever image you want and convert them to ICO using this online utility. Once you have the icon you want, apply it to the shortcut and then pin to Start.
 
I couldn't get the bat to work and output to my desktop. Does it matter if I have more than one user profile?

I tried running as admin no luck

It's an SP3 with windows 10 installed.
 
open a .txt file.... paste this code... save.. rename as .bat
Create a folder called "Battery Log" on the Desktop.

Start it normaly = Battery Log
Start it with admin privilegs = Sleepstudy + Battery Log

Code:
set DD=%DATE:~0,2%
set MM=%DATE:~3,2%
set YY=%DATE:~8,2%
set YYYY=%DATE:~6,4%
set HH=%TIME:~0,2%
set MN=%TIME:~3,2%
powercfg /batteryreport /output "%USERPROFILE%\Desktop\Battery Log\battery_report_%YYYY%.%MM%.%DD%-%HH%%MN%.html" & powercfg /sleepstudy /output "%USERPROFILE%\Desktop\Battery Log\sleep_report_%YYYY%.%MM%.%DD%-%HH%%MN%.html"
 
Back
Top