Skip to content

Instantly share code, notes, and snippets.

@dima-iholkin
Last active April 7, 2021 23:48
Show Gist options
  • Save dima-iholkin/65465dbcdafa49b168d3b618e5ebcd27 to your computer and use it in GitHub Desktop.
Save dima-iholkin/65465dbcdafa49b168d3b618e5ebcd27 to your computer and use it in GitHub Desktop.
Win10 hibernate
@ECHO off
SETLOCAL enabledelayedexpansion
SET /p var=Want to Hibernate? [Y/N]:
@REM Convert y to Y:
IF %var%== y (
SET var=Y
)
IF %var%== Y (
START "" "C:\Windows\System32\shutdown.exe" /h
) ELSE (
@REM echo Canceled.
@REM pause
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment