TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. edupontocps
    3. Posts
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Best 1
    • Controversial 0
    • Groups 0

    Posts made by edupontocps

    • RE: Laptop Battery Management - Automated On/Off Cycle

      Hey guys,

      I created this process in Python and I don't need to use the BatteryInfoView.exe program.
      I have Windows 11 and I'm using the "Task Scheduler" function to run in a loop that repeats itself every 5 minutes.

      Here is the script

      import psutil, os, time
      
      bateria = psutil.sensors_battery()
      
      plugado = bateria.power_plugged
      
      if plugado:
          if bateria.percent == 100:
              os.startfile('D:\Downloads\Bateria\plugOff.bat')
              time.sleep(10)
          else:
              pass
          
      else:
          if bateria.percent <= 20:
              os.startfile('D:\Downloads\Bateria\plugON.bat')
              time.sleep(10)
          else:
              pass
      

      Where

      The file plugOff.bat has the code
      tcmdWin.exe --computer your_name_computer --trigger plugOff

      The file plugOn.bat has the code
      tcmdWin.exe --computer your_name_computer --trigger plugOn

      posted in Example Commands
      edupontocpsE
      edupontocps