Skip to content

Instantly share code, notes, and snippets.

@rotten77
Created September 16, 2013 09:34
Show Gist options
  • Save rotten77/6578512 to your computer and use it in GitHub Desktop.
Save rotten77/6578512 to your computer and use it in GitHub Desktop.
Automatické vypnutí PC po určitém čase
@ECHO off
@CHOICE /T:10 /C:12345s /M "Za jak dlouho vypnout? (1) 1 hod, (2) 20 minut, (3) 10 minut, (4) 5 minut, (5) hned, (s) zrusit" /D:1
IF ERRORLEVEL 6 GOTO zero
IF ERRORLEVEL 5 GOTO five
IF ERRORLEVEL 4 GOTO four
IF ERRORLEVEL 3 GOTO three
IF ERRORLEVEL 2 GOTO two
IF ERRORLEVEL 1 GOTO one
GOTO end
:zero
shutdown -a
GOTO end
:one
shutdown -s -f -t 3600
GOTO end
:two
shutdown -s -f -t 1200
GOTO end
:three
shutdown -s -f -t 600
GOTO end
:four
shutdown -s -f -t 300
GOTO end
:five
shutdown -s -f
GOTO end
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment