Last active
April 30, 2023 10:53
-
-
Save ErykDarnowski/e2f9027a2fb575b4eb2b43e3f2b1bf58 to your computer and use it in GitHub Desktop.
How to automatically generate and open a battery report file on Windows
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:: Vars: | |
SET filename=battery-report.html | |
:: Generate the battery report file (in script's path): | |
powercfg /batteryreport > nul | |
:: Open the file (in the default browser): | |
start "" ./%filename% | |
:: Remove the file (after waiting 1s to allow the browser to load it): | |
timeout /t 2 /nobreak > nul | |
del %filename% |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment