win10实现倒计时锁屏,休眠

时间:2024-04-16 11:10:13

@ECHO OFF&SETLOCAL ENABLEDELAYEDEXPANSION

SET /a s=10+1
FOR /l %%i in (1,1,!s!) do (
SET /a s-=1
ping -n 2 127.1>nul
title 【注意:电脑即将进入睡眠......倒计时开始:】 !s!
)

:: 锁屏
rundll32.exe user32.dll LockWorkStation

:: 休眠
::START "" rundll32.exe powrprof.dll,SetSuspendState 0,1,0

 

 

参考:

https://blog.****.net/qingfengjuechen/article/details/87739120

 

 

 

https://www.cnblogs.com/bluestorm/p/10858378.html