Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Shell 

Battery Report & Energy Statistics

This script was made so that you could easily generate a battery report / energy report and have it automatically delete itself afterwards. This script can be run from a USB drive as well. If you are having battery problems on any laptops / tablets running Windows these reports will help you get an easy grasp on what is going on. I hope this helps someone :)

Code
::This file detects which version of windows you are running
::and dynamically chooses the appropriate way to view battery
::and energy related information.
::
::It then automatically deletes any files it generated and exits.
::
::Scripted by mf666
::Contact me @ [email protected]

@echo off
%systemdrive%
cd %temp%
set TTL=title Battery Report Generator -
set EXMS=echo Exiting...
%TTL% Checking Windows Version

echo Checking Windows version...
setlocal
for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
set VRMS=echo Windows version %version% detected!
if "%version%" == "10.0" %TTL% Windows 10 & %VRMS% & goto :8PLUS
if "%version%" == "6.3" %TTL% Windows 8.1 & %VRMS% & goto :8PLUS
if "%version%" == "6.2" %TTL% Windows 8 & %VRMS% & goto :8PLUS
if "%version%" == "6.1" %TTL% Windows 7 & %VRMS% & goto :SEVEN
endlocal

goto :ERROR1

:ERROR
%TTL% He's dead Jim...
echo. & echo ====SOMETHING SEEMS TO HAVE GONE WRONG!====
echo Try running this script as an administrator!
pause
%EXMS%
ping localhost > nul
exit

:ERROR1
%TTL% Incompadible Windows version...
echo. & echo This script only supports Windows version 6.1 (7) - 10.0...
echo Your version is:
ver
pause
%EXMS%
ping localhost > nul
exit

:8PLUS
echo Generating battery report...
powercfg /batteryreport
if exist "Battery-Report.html" start /wait Battery-Report.html else goto :ERROR
echo Waiting...
ping localhost > nul
echo Deleting temp files...
del /f /q Battery-Report.html
%EXMS%
exit

:SEVEN
echo Building energy report...
powercfg /energy
if exist "energy-report.html" start /wait energy-report.html else goto :ERROR
echo Waiting...
ping localhost > nul
echo Deleting temp files...
del /f /q energy-report.html
%EXMS%
exit
People here really have a problem with scripts that are practical.
This is so good, the presentation is amazing, and now I know how screwed my battery actually is! :D
Hope you stick around here!
Keep me fed and alive at Uni: Bitcoin Bitcoin: 16cwoYXfhaK6V5c8kJKn9SBMtDUARUs7BS
I'll draw terrible art in paint.NET for you, on request, in return <3
(Jan 28, 2017 09:07 PM)motherfawker666 Wrote:  People here really have a problem with scripts that are practical.

So damn true. I'm sorry you didn't get any recognition on this.
Hi motherfawker666 ✌
Very nice script ! i like it and i will use it with your permission if you don't mind ! 🤗
I tested on my windows 7 (32 bits) and it worked like a charm
Very useful script ! 👍
Thank you for this nice share ! and don't stop to share other useful scripts like that 😉
cheers
👍
You are all free to use this tool as you see fit. I require/desire no attribution.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[Python] by heretobrowseAug 18, 2017 02:33 PM 5 178 Aug 18, 2017 02:33 PM
Last Post: Goodies
[C#] by morphine1337Dec 27, 2013 05:10 AM 10 590 Dec 27, 2013 05:10 AM
Last Post: Dennis
[.NET] by SeNmaNFeb 4, 2013 09:00 PM 5 148 Feb 4, 2013 09:00 PM
Last Post: MasterJackal