I remember watching a “How to create a computer virus” video on youtube maybe a decade ago, where the guy basically made a bat file with a shutdown command and called it a virus!
To a kid like me that was amazing: Being able to shutdown ones computer by running a file on it.
Fast forward 10+ years into the future and I know its a simple command that does exactly what it’s made for: shutdown Windows.
The CMD SHUTDOWN command performs a graceful shutdown of the computer running Windows.
shutdown [/i | /l | /s | /r | /a | /p | /h | /e] [/f] [/m \\<computername>] [/t <XXX>] [/d [p|u:]<XX>:<YY> [/c "comment"]]
SHUTDOWN CMD Parameters
- /s – graceful shutdown with a warning
- /r – restart Windows
- /p – force shutdown without a warning
- /F – close all programs and force shutdown
- /t – time interval (seconds)
- /a – abort (if using time interval)
- /L – log off current user
- /H – enter hibernation mode
- /M – shutdown remote PC in the network
- /i – display Remote Shutdown box
- /e – document the reason for shutdown
- /c – comment the reason for the shutdown