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

Eduardo de Campos

@edupontocps

1
Reputation
3
Profile views
1
Posts
0
Followers
0
Following
Joined May 19, 2023, 12:56 PM Last Online May 19, 2023, 1:22 PM
Location Brasil

edupontocps Unfollow Follow

Best 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
    E
    edupontocps
    May 19, 2023, 1:22 PM

Latest 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
    E
    edupontocps
    May 19, 2023, 1:22 PM