关闭显示器的脚本

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

相关推荐
福大大架构师每日一题1 天前
rustdesk 1.4.3 发布:新增虚拟鼠标、Wayland 多显示器支持等功能
计算机外设·rustdesk
梓默1 天前
鼠标偶尔卡顿解决方法
计算机外设
Jwest20211 天前
工业显示器在矿用挖掘机中的应用
计算机外设
lzhdim1 天前
雷蛇(Razer)炼狱蝰蛇V2X极速版无线鼠标开箱
单片机·嵌入式硬件·计算机外设
晋人在秦 老K3 天前
鼠标连点效率低?MouseClickTool 2.0三步配置,自动化操作提速80% 重复点击太耗时?Windows鼠标连点器实操教程,开发测试效率翻倍
windows·自动化·计算机外设·鼠标连点器·gui模拟点击·自动化点击解决方案
jbk33113 天前
监听指定事件然后触发鼠标点击操作等,智能文本识别按键工具的使用教程
计算机外设
安卓开发者4 天前
鸿蒙NEXT鼠标光标开发完全指南
华为·计算机外设·harmonyos
雨中风华4 天前
Windows 平台 HOOK DWM 桌面管理程序,实现输出变形的桌面图像到显示器
windows·计算机外设
Jwest20214 天前
工业显示器在微铣削机床中的应用
计算机外设
qq_546937276 天前
KeepMouseSpeedOK:专业鼠标速度调节工具
计算机外设