关闭显示器的脚本

一、用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)

相关推荐
微光闪现3 天前
游戏中快速点击的终极武器:罗技GPW5雪豹电竞鼠标深度解析
大数据·游戏·计算机外设
2501_947908203 天前
雷鸟×七彩虹联动!雷鸟U8A Pro显示器一屏双模开启电竞美学
计算机外设
Legendary_0083 天前
便携显示器C口功能解析及LDR6020双盲插投屏原理
c语言·开发语言·计算机外设
墩墩冰3 天前
计算机图形学 分子模型
计算机外设
男孩李3 天前
笔记本电脑连接Hdmi显示器没反应,提示“未检测到其他显示器”。
计算机外设·电脑
LucianaiB3 天前
我发现了适合程序员的完美显示器
计算机外设
鸽芷咕3 天前
有了 AI 写代码,还缺什么?资深工程师:28 寸专业编程显示器 + Cursor 告别代码疲劳
ai·计算机外设·显示器·明基rd320u·编码体验
汪子熙3 天前
只让键盘或电源键唤醒:Windows 禁止鼠标唤醒的可操作指南
windows·stm32·计算机外设
Jwest20213 天前
工业显示器在3D缝纫机器人中的应用
3d·机器人·计算机外设
永霖光电_UVLED3 天前
KAIST 团队研发出高效、超高分辨率的红色微米发光二极管(Micro-LED)显示器
计算机外设