Board logo

标题: [其他] [分享]延时10秒熄灭显示屏并锁定用户.bat [打印本页]

作者: yiyue7    时间: 2019-10-20 19:55     标题: [分享]延时10秒熄灭显示屏并锁定用户.bat

10秒可以自行修改
  1. @echo off
  2. ::延时
  3. ping -n 10 127.1 >nul
  4. ::息屏
  5. powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::SendMessage(-1,0x0112,0xF170,2)
  6. ::锁屏
  7. rundll32 user32.dll,LockWorkStation
复制代码

作者: 708841460    时间: 2019-10-21 09:28

回复 1# yiyue7


    感谢楼主分享,请问批处理能否在执行完后终止,我在结尾加上exit没实现效果
作者: yiyue7    时间: 2021-9-23 08:07

回复 2# 708841460
终止,按esc键或晃晃鼠标就亮了。




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2