Last active
January 16, 2017 05:09
-
-
Save toagit/32abc2ff1642e7926c0d6351aeaef246 to your computer and use it in GitHub Desktop.
指定時刻にシャットダウンするWindowsBatch
ATやタスクスケジューラーが使えない環境用
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem 指定時刻にシャットダウンするバッチ | |
rem 秒は許容誤差とし、算出しない | |
rem 18:00にシャットダウン | |
set HOUR=18 | |
set /a H=%HOUR%-1-%TIME:~0,2% | |
set /a M=60-%TIME:~3,2% | |
echo %HOUR%時まで%H%時間%M%分 | |
set /a S=%H%*3600+%M%*60 | |
echo %S% | |
rem shutdown /s /t %S% | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment