Reputation: 385
I have a pretty (to what I imagine) simple question/request for help. The only problem is I am not sure how to really have the script set up, so I would very much appreciate any help/suggestions.
Here's exactly what I am looking for in my batch file:
...and that's really it :o)
With that said, leading to my question, is initiating a shutdown from a batch file a 'clean' shutdown? For example, are you calling Windows shutdown, safely saving/closing any currently opening applications, and then shutting down? Or is it forcing the system to not save any work, and shuts off 'unsafe'? I imagine it's the former, although I just want to be sure.
Regards,
Patrick
Upvotes: 1
Views: 2793
Reputation: 21
Shutting down through the "shutdown" command is perfectly safe. I've done it many times on my computers and nothing has happened. So to make this batch file, all you're going to need to do is paste this one line in:
shutdown /s /t 7200
The /s flag tells Windows to shutdown, and the /t flag tells it to shutdown after a certain amount of time in seconds. In this case, you want 7,200 seconds, or 2 hours. Good luck!
EDIT: I see that someone already beat me to answering the question lol
Upvotes: 2
Reputation: 46
@echo off
shutdown /s /t 7200
Save this with a .bat extention and this will shutdown your computer safely just like shuting it down from the desktop
Upvotes: 1