Automated battery reports

Discussion in 'Microsoft Surface Pro 3' started by nipponham, Oct 4, 2014.

  1. nipponham

    nipponham Active Member

    Joined:
    Sep 24, 2014
    Messages:
    399
    Likes Received:
    78
    Trophy Points:
    28
    Location:
    Japan
    My Device:
    SPro3
    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:
    [​IMG]

    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.)
     

    Attached Files:

    Last edited: Oct 4, 2014
    ctitanic, Jeff Au and Aurelio like this.
  2. Jesse San Nicolas

    Jesse San Nicolas Member

    Joined:
    Sep 24, 2014
    Messages:
    50
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    San Antonio, TX
    My Device:
    SPro3
    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: Oct 5, 2014
    ctitanic likes this.
  3. nipponham

    nipponham Active Member

    Joined:
    Sep 24, 2014
    Messages:
    399
    Likes Received:
    78
    Trophy Points:
    28
    Location:
    Japan
    My Device:
    SPro3
    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.
     
  4. Jeff Au

    Jeff Au Member

    Joined:
    Sep 7, 2014
    Messages:
    37
    Likes Received:
    4
    Trophy Points:
    8
    Location:
    Malaysia
    My Device:
    SPro3
    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/.
     
  5. Jesse San Nicolas

    Jesse San Nicolas Member

    Joined:
    Sep 24, 2014
    Messages:
    50
    Likes Received:
    16
    Trophy Points:
    8
    Location:
    San Antonio, TX
    My Device:
    SPro3
    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.
     
  6. sean_scouser

    sean_scouser Member

    Joined:
    Jul 29, 2014
    Messages:
    99
    Likes Received:
    12
    Trophy Points:
    8
    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
     
  7. nipponham

    nipponham Active Member

    Joined:
    Sep 24, 2014
    Messages:
    399
    Likes Received:
    78
    Trophy Points:
    28
    Location:
    Japan
    My Device:
    SPro3
    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.
     
  8. ctitanic

    ctitanic Well-Known Member

    Joined:
    Nov 3, 2012
    Messages:
    2,194
    Likes Received:
    577
    Trophy Points:
    113
    Location:
    Hollywood, FL
    My Device:
    SPro3
    I have been using batches to run these and other reports. That's the way to go.
     
    jonypx09 likes this.
  9. Tatletz

    Tatletz Member

    Joined:
    Aug 27, 2014
    Messages:
    53
    Likes Received:
    0
    Trophy Points:
    6
    Thank you nipponham, works great on my windows 10 recently upgraded SP3.
     
  10. howars01

    howars01 New Member

    Joined:
    Aug 4, 2014
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    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.
     
  11. Haldi

    Haldi Member

    Joined:
    Nov 27, 2014
    Messages:
    199
    Likes Received:
    15
    Trophy Points:
    18
    My Device:
    SPro3
    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"
     

Share This Page

Search tags for this page

microsoft surface battery report script

,

surface 3 battery report short cut

,

surface pro forumsnbattery report