Question

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:

  • When I execute the batch file, it initiates a shutdown in ~2 hours.

...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

Was it helpful?

Solution 2

@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

OTHER TIPS

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top