关闭显示器的脚本

一、用BAT脚本关闭显示器

shutdown_monitor.bat

%windir%\System32\scrnsave.scr /s

二、用BAT调PowerShell脚本关闭显示器

RunPowerShellScript.bat

@echo off

powershell -NoProfile -ExecutionPolicy Bypass -File "TurnOffMonitor.ps1"

pause

TurnOffMonitor.ps1

Add-Type '[DllImport("user32.dll")]public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Namespace b

b.a\]::SendMessage(-1, 0x0112, 0xF170, 2) Write-Host "The monitor is now turned off." -ForegroundColor Green 效果: 显示器会黑屏,移动鼠标或键盘会恢复。 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/63746583b2a942d0bf03aea2e160d9c5.png)

相关推荐
智塑未来6 小时前
2026年飞利浦高性价比护眼显示器调研:核心技术与耐用机型解析
计算机外设
命运之光13 小时前
在 Windows 上实现「可调速的直播场景鼠标单击」:从 SendInput 到间隔策略的技术笔记
windows·笔记·计算机外设·推流工具·直播推流工具
开开心心就好1 天前
完美兼容Office格式的免费办公套件
windows·均值算法·计算机外设·word·excel·csdn开发云·图搜索算法
AI周红伟1 天前
Windows 支持 Hermes Agent 吗:原生 Windows 安装 + WSL2 路径完整指南
数据库·人工智能·windows·阿里云·职场和发展·计算机外设
开开心心_Every1 天前
能把网页藏在Word里的实用摸鱼工具
人工智能·科技·目标跟踪·pdf·计算机外设·语音识别·mllib
LCD液晶屏2 天前
立煌G101UAN04.0友达代理10.1寸LCD工业液晶屏竖屏显示器规格参数
计算机外设
shandianchengzi4 天前
【记录】联想|Thinkpad雷电接口连接带鱼屏显示器,画面被异常拉伸怎么解决?
windows·计算机外设·显示器·联想·thinkpad
俊哥工具5 天前
解决网速卡顿、断网、网络报错,万能网络修复工具教程
网络·python·django·计算机外设·智能路由器·pygame
nashane6 天前
HarmonyOS 6学习:外接键盘CapsLock键“失灵”?一招解锁大写输入
学习·华为·计算机外设·harmonyos
HezhezhiyuLe6 天前
无界内嵌编辑器键盘事件失效
编辑器·计算机外设