Skip to content

Instantly share code, notes, and snippets.

@heiswayi
Created May 11, 2023 03:41
Show Gist options
  • Save heiswayi/0d27ad0180113ed1e40eee813459aa06 to your computer and use it in GitHub Desktop.
Save heiswayi/0d27ad0180113ed1e40eee813459aa06 to your computer and use it in GitHub Desktop.
@echo off
rem Set the time for the hibernation
set /p time="Enter the time for the hibernation (in 24-hour format): "
rem Convert the time to a Unix timestamp
rem (This is necessary for the shutdown command)
set timestamp=%time:~0,2%%time:~3,2%%time:~6,2%000
rem Hibernate the computer
shutdown /h /t %timestamp%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment