Hack Forums
[Shell] Enable or Disable Battery Life Estimated Time Remaining in Windows 10 - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151)
+---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118)
+---- Thread: [Shell] Enable or Disable Battery Life Estimated Time Remaining in Windows 10 (/showthread.php?tid=6004658)



Enable or Disable Battery Life Estimated Time Remaining in Windows 10 - Emre_ - Sep 3, 2019

This batch script will enable or disable showing the battery life estimated time remaining for the Power icon on the taskbar for all users in Windows 10.

Code
:: Enable or Disable Battery Life Estimated Time Remaining in Windows 10

@Echo Off & Cls


net sess>nul 2>&1||(powershell start cmd -ArgumentList """/c %~0""" -verb Runas & exit)



Cls & Mode CON  LINES=11 COLS=85 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo        Do You Want to Show Battery Life Estimated Time Remaining (Y/N)?  
Echo.      
Echo.
Echo.


Set /p input= RESPONSE:

If /i  Not %input%==Y (Goto :_Ex) Else (Goto :_Start)

:_Ex
If /i Not %input%==N  (Goto :EOF) Else (Goto :_RegRestore)



:_Start

Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "EnergyEstimationDisabled" /f
Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "UserBatteryDischargeEstimator" /f
Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "EnergyEstimationEnabled" /t REG_DWORD /d "1" /f


Cls & Mode CON  LINES=11 COLS=65 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo          Enabling Showing Battery Life Estimated Time Remaining
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit


:_RegRestore

Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "EnergyEstimationDisabled" /t REG_DWORD /d "1" /f
Reg.exe add "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "UserBatteryDischargeEstimator" /t REG_DWORD /d "1" /f
Reg.exe delete "HKLM\SYSTEM\CurrentControlSet\Control\Power" /v "EnergyEstimationEnabled" /f



Cls & Mode CON  LINES=11 COLS=60 & Color 0E & Title Created By FreeBooter
Echo.
Echo.
Echo.
Echo.
Echo        Disabling Battery Life Estimated Time Remaining  
Echo.
Echo.
Echo.
Ping -n 6 localhost >Nul
Exit