- UID
- 4888149
- 最后登录
- 1970-1-1
- 阅读权限
- 20
- 精华
- 主题
- 回帖
- 0
- 积分
- 84
- PB币
-
- 威望
-
- 贡献
-
- 技术
-
- 活跃
-
|
本帖最后由 salanhe 于 2025-3-19 20:20 编辑
恢复速度:睡眠>休眠,你一会说休眠,一会说睡眠,我有点懵,关于快捷,我是习惯加一个环境变量,把软件啊批处理什么的所有快捷方式丢到那个文件夹里,用Win+R运行也是很快的。
顺便分享一个我研究出来的定时休眠批处理(不是高手,语法错误或者代码效率低勿喷)
%1 mshta vbscript:CreateObject("Shell.Application").ShellExecute("cmd.exe","/c %~s0 ::","","runas",1)(window.close)&&exit
@echo off
setlocal
echo 删除上次定时休眠任务:
echo.
schtasks /delete /tn 定时休眠 /F && (echo.) || (echo (上次定时休眠任务不存在,无需删除))
echo ============================================================
echo 创建新的定时休眠任务:
rem 获取时间年月日
set xmdate=jdate
set yyyy=%date:~,4%
set mm=%date:~5,2%
set day=%date:~8,2%
rem 把年月日串中的空格去掉
rem set yyyy=%yyyy: =%
rem set mm=%mm: =%
set day=%day: =%
echo.
set /p hao=提示:j表示今天,m表示明天,几号用1——31表示。休眠日期:
if %hao%==j (
set xmdate=%yyyy%/%mm%/%day%
)
::获取明天的号daypp
set daypp=%day%
set checkday=%daypp:~0,1%
if %checkday%==0 (set daypp=%daypp:~1,1%)
set /a daypp=daypp+1
if %daypp% lss 10 (set daypp=0%daypp%)
if %hao%==m (
set xmdate=%yyyy%/%mm%/%daypp%
)
::处理号数,小于10数字前面加0
if %hao% lss 10 (set hao=0%hao%)
if not %hao%==j (
if not %hao%==m (
set xmdate=%yyyy%/%mm%/%hao%
)
)
echo.
echo 休眠日期:%xmdate%
echo.
echo tip:休眠时间留空为00
set /p hh=休眠时间(时):
if (%hh%)==() (set hh=00)
if %hh% lss 10 (set hh=0%hh%)
if %hh%==000 (set hh=00)
set /p mi=休眠时间(分):
if (%mi%)==() (set mi=00)
if %mi% lss 10 (set mi=0%mi%)
if %mi%==000 (set mi=00)
set /p ss=休眠时间(秒):
if (%ss%)==() (set ss=00)
if %ss% lss 10 (set ss=0%ss%)
if %ss%==000 (set ss=00)
set time=%hh%:%mi%:%ss%
echo 定时休眠时间为:%xmdate%-%time%
rem 创建新任务
schtasks /create /tn "定时休眠" /tr "rundll32.exe powrprof.dll,SetSuspendState" /sc once /sd %xmdate% /st %time%
echo ============================================================
echo.
set daotime=5
:dao
set /a daotime-=1
ping -n 2 -w 500 127.1>nul
echo %daotime%秒后自动关闭窗口
if %daotime%==0 (exit) else (goto dao)
endlocal
|
|