自己写的,不嫌弃可以试用一下- @echo off
- setlocal enabledelayedexpansion
- color 0f
-
- :main
- set "ds1= "
- set "ds2= "
- set "ds3= "
- set "ds!cho!=√"
- if "!cho!"=="3" (set "dsm=!min!分") else (set "dsm=")
- :main0
- cls
- echo ┌───────────────┐
- echo 丨### 电源计划管理 ###丨^[显示器关闭时间^]
- echo ├───────────────┤
- echo 丨 1-极省(1分钟后关闭)!ds1! 丨
- echo 丨 2-持久(从不关闭)!ds2! 丨
- echo 丨 3-自定义时间 !ds3! 丨!dsm!
- echo 丨 0-电源配置 丨
- echo └───────────────┘
- set "cho="
- set /p cho=请选择:
- if "!cho!"=="1" (
- powercfg -x -monitor-timeout-ac 1
- goto main
- )
- if "!cho!"=="2" (
- powercfg -x -monitor-timeout-ac 0
- goto main
- )
- :define
- if "!cho!"=="3" (
- set "min="
- set /p min=请输入自定义时间^(单位:分^):
- echo !min!|findstr /be "[0-9]*" >nul || echo 请输入纯数字 && pause>nul && goto define
- powercfg -x -monitor-timeout-ac !min!
- goto main
- )
- if "!cho!"=="0" (
- powercfg -list
- pause>nul
- goto main0
- )
- exit
复制代码 大致效果 |