您现在的位置是:网站首页> 编程资料编程资料
win7怎么设定关闭显示器时间_DOS/BAT_
2023-05-25
334人已围观
简介 win7怎么设定关闭显示器时间_DOS/BAT_
使用windows 批处理实现 设置关闭显示的时间。
@echo off
setlocal enabledelayedexpansion
echo "请输入关闭显示器的时间,单位是分钟,默认1分钟"
set /p "timeout="
if NOT DEFINED timeout (echo "你输入的时间是1分钟" && set "timeout=1" && goto set_monitor_timeout
)else ( rem 注意这里else语句和括号的位置关系
echo "你输入的时间是%timeout%分钟"
)
:set_monitor_timeout
echo "你输入的时间是%timeout%分钟"
echo "当前系统使用的电源管理方案是:"
echo ==============================================
powercfg -list >c:\powercfg_mingli |@findstr "*" c:\powercfg_mingli
powercfg -x -monitor-timeout-ac %timeout%
echo ==============================================
del /f /s /q c:\powercfg_mingli
pause
复制代码 代码如下:
@echo off
setlocal enabledelayedexpansion
echo "请输入关闭显示器的时间,单位是分钟,默认1分钟"
set /p "timeout="
if NOT DEFINED timeout (echo "你输入的时间是1分钟" && set "timeout=1" && goto set_monitor_timeout
)else ( rem 注意这里else语句和括号的位置关系
echo "你输入的时间是%timeout%分钟"
)
:set_monitor_timeout
echo "你输入的时间是%timeout%分钟"
echo "当前系统使用的电源管理方案是:"
echo ==============================================
powercfg -list >c:\powercfg_mingli |@findstr "*" c:\powercfg_mingli
powercfg -x -monitor-timeout-ac %timeout%
echo ==============================================
del /f /s /q c:\powercfg_mingli
pause
您可能感兴趣的文章:
相关内容
- 再谈DOS批处理下格式化日期字符串的三种方法(详解)_DOS/BAT_
- 用注册表更改DNS的代码分享_DOS/BAT_
- 通过批处理修改DNS的代码(推荐)_DOS/BAT_
- 使用批处理实现软件的自动安装以安装搜狗拼音为例_DOS/BAT_
- cacls命令设置文件及其文件夹权限的方法_DOS/BAT_
- 使用批处理bat更改hosts的多个方法_DOS/BAT_
- VBS和bat批处理逐行读取文件实例_DOS/BAT_
- 使用bat批处理来安装和卸载ASP组件_DOS/BAT_
- bat批处理一键登录网易163和126邮箱_DOS/BAT_
- bat批处理彻底隐藏文件的方法(使用虚拟磁盘实现)_DOS/BAT_
