📜  power cfg on - C# (1)

📅  最后修改于: 2023-12-03 15:33:46.327000             🧑  作者: Mango

Introduction to Power cfg on - C#

Power cfg on is a command line tool used to manage power settings on your Windows computer. It can be particularly useful for those who want to conserve energy or those who want to prevent their computer from going to sleep during specific tasks.

Syntax of power cfg on

The syntax of power cfg on is:

powercfg /CHANGE monitor-timeout-ac <minutes>
powercfg /CHANGE monitor-timeout-dc <minutes>
powercfg /CHANGE standby-timeout-ac <minutes>
powercfg /CHANGE standby-timeout-dc <minutes>
powercfg /CHANGE hibernate-timeout-ac <minutes>
powercfg /CHANGE hibernate-timeout-dc <minutes>
  • monitor-timeout-ac sets the time in minutes before the monitor turns off when the computer is connected to a power source (AC).
  • monitor-timeout-dc sets the time in minutes before the monitor turns off when the computer is running on battery power (DC).
  • standby-timeout-ac sets the time in minutes before the computer goes into standby mode when it is connected to a power source (AC).
  • standby-timeout-dc sets the time in minutes before the computer goes into standby mode when it is running on battery power (DC).
  • hibernate-timeout-ac sets the time in minutes before the computer goes into hibernate mode when it is connected to a power source (AC).
  • hibernate-timeout-dc sets the time in minutes before the computer goes into hibernate mode when it is running on battery power (DC).
Examples
  • To set the monitor timeout to 30 minutes when the computer is running on battery power, enter:
powercfg /CHANGE monitor-timeout-dc 30
  • To prevent the computer from going into standby mode when it is connected to a power source, enter:
powercfg /CHANGE standby-timeout-ac 0
  • To set the hibernate timeout to 120 minutes when the computer is running on battery power, enter:
powercfg /CHANGE hibernate-timeout-dc 120
Conclusion

Power cfg on is a helpful tool for managing the power settings of your Windows computer. By using the commands described above, you can conserve energy and prevent your computer from going to sleep during important tasks.