I'd like to download and install an app into my Windows 7 machine that at a fixed time, will automatically popup a shutdown timer, that can be cancelled if an user is actively using the computer, but will shutdown automatically in 5 minutes for example, if no one is using the computer. Does anyone know if there is an application like this?

Also, if cancelled, it should popup again after like 15-30 minutes.

  • So is it five minutes or 15-30? Do you want the user to be able to manually cancel the shut down or for it to silently skip the shut down for a while and try again later? When you say "shutdown automatically in 5 minutes", do you mean that if the system is busy being used, the program will wait five minutes then shut down anyway, even if it is still being used? – Synetech Jun 21 '12 at 19:48

I've written a little program that does this. You'll need to have .NET 3.5, but Windows 7 comes with that anyway.

It opens a window when launched with a timer, and shuts down with the timer completes. There's an option to postpone for a specified number of minutes, and an option to abort.


If launched with no arguments, it waits 5 minutes before shutdown (if you postpone, it will start this delay again when the postponed period is up). If launched with a number, it takes that as the number of minutes to wait when first started or when the postponed period is up.

Default 5 minutes:


10 minutes:

IdleShutdown.exe 10

Half a minute:

IdleShutdown.exe 0.5

You said you wanted a program that:

at a fixed time, will automatically popup a shutdown timer, that can be cancelled if an user is actively using the computer, but will shutdown automatically in 5 minutes

Also, if cancelled, it should popup again after like 15-30 minutes.

This does all of that except the starting at a fixed time. You can use the Task Scheduler as many others have answered. I don't interpret 'at a fixed time' as 'when the computer is idle', so everything is timer based.

It runs the command shutdown /s /t 0 to actually start the shutdown. A word of warning - the /t 0 means it's a forced shutdown, which means it doesn't wait forever for programs to close and will end processes if they take too long. A safer option may be to hibernate and, if you want, it's quite easy to change - just drop a comment. Or even do it yourself; all the source code is at the linked GitHub repository.


Without 3rd party tools

You can read this article on How to : Schedule Computer Shutdown After Specific Period of Time if you don't want to use third party software. Also MS Support will help you regarding this.

You can create a batch file like this

@echo off
shutdown /s /f /t 600 /c "Your system will shutdown in 10 minutes"

And save it with the name of shutdown.bat and put it on desktop to launch it.

Now for aborting it you can use this command

shutdown /a

Shutdown through Batch file with prompt and abort operation

SET /P continue="Your computer is about to shutdown in 10 min do you want to abort (y/n): "
IF %continue% EQU y (
GOTO myLabel

Now save it with the name of your choice with the .bat extension. And now whenever you want to run it use the right clcik on it and choose Run as Admin option and it will prompt you to abort the operation if you want to abort enter the input Y and hit Enter shutdown operation will abort for 10 min and it will ask you agsin after 10 min until you don't shut it down.

Using 3rd party tool

I will recommend you the Autoshutdown which is free and quite helpful.

Auto Shutdown is a simple utility that allows users to schedule times for their computers to shut down or restart automatically. It's nothing fancy, but it's easy to use, and the scheduling is surprisingly customizable.

You can also use SwitchOff tool for this.

This handy program is a PC timer that can shut down, log off, or force your computer to hibernate. It works either as a countdown timer, or set up like an alarm clock. When the proper time is reached, SwitchOff shuts down all open applications and performs its task. You can configure it to operate daily, weekly, or for a single occurrence.

TimeComX is another recommended one you can use for shutdown, restart, log off etc.

  • I used to use Switch Off a long time ago, but I have been using the shutdown command instead for years because it’s just easier. I recommend Switch Off 2.3 instead of the rebuilt 3.0+ versions; it’s cleaner and easier to use. – Synetech Jun 21 '12 at 6:49
  • @Synetech I always use the batch file no third party tool. Its much easier to use it and you can abort with just run command or another batch file. However sometime I used 3rd party tool when I was a newbie, you know kind of craze to collect the new software ;) – avirk Jun 21 '12 at 6:54
  • Switch Off provides quite a few more options than shutdown does. On the other hand, shutdown lets you add a message to the event log (which newer versions of Switch Off may or may not also support). – Synetech Jun 21 '12 at 6:56
  • @Synetech yes it has. i.imgur.com/jclSrs.jpg Now also uses the script option:) – avirk Jun 21 '12 at 7:05
  • 1
    @avirk, how/where do you detect if the system is idle? (Hmm, I don't think I have ever heard of a console tool that can let you determine idleness.) o.O – Synetech Jun 27 '12 at 15:37

Windows have the command shutdown built-in.

For shutting down in 5 minutes:

shutdown /s /t 300 /c "Shutting down in 5 minutes"

For canceling:

shutdown /a

You can create a shortcut for cancelling, and create a scheduled task for showing the shutdown window.

  • That isn't very convenient for the people who will be using the computer. This would only work if I were using the computer, but in that case I'd rather shutdown the computer myself. – Bogdacutu Jun 21 '12 at 5:18
  • @Alvin, that is not enough. Bogdacutu wants a way to make it so that at a specific time, the system begins checking if the system is idle every five minutes until it is idle, then to shut down. It probably can be done with the shutdown command, but the single line you offered certainly does not cut it. – Synetech Jun 21 '12 at 16:51

I'd use schedule tasks for this. You can use commands which Alvin Wong mentioned above. You would create a task that would execute shutdown /s /t 300 /c "Shutting down in 5 minutes" lets say, every 15 minutes. And to cancel this shutdown you could use shutdown /a which could be ran via desktop icon.

Also you could set in your Power Management to sleep or hibernate your PC after given time. This is not exactly what you're asking for, but I think that it might do the trick.

  • You are the closest one yet. It's not quite enough, but +1 because you are on the right track. – Synetech Jun 21 '12 at 16:53

Going off of everyone else's answers that don't seem to be getting accepted, I decided to make a full walk through. This will assume you have Administrative rights, or at least enough rights to shut down the system, and create tasks using the Task Scheduler.

  1. Click Start, type Task Scheduler and press Enter
  2. On the right, click Create Task
  3. Under Name, type in a name (i.e. Shutdown)
  4. Click Triggers->New
  5. Choose on the left hand side how often to run (i.e. Daily). Then, choose the time to start the task on the right. Make sure it's a time at least a few minutes in the future, so you can test this!
  6. Under Advanced Settings, check Repeat task every: and choose a time (i.e. 15 minutes). This way, if you cancel the task, it will come back in 15 minutes and re-start the task of trying to shut down.
  7. Ensure Enabled is checked. Click OK
  8. Click Action->New
  9. Under Program/script, type C:\Windows\System32\shutdown.exe. Under Add arguments (optional), type -s -t 300 /c "Shutting down in 5 minutes unless you abort...". You can change the 300 to whatever number of seconds warning you want to give the user. Click OK
  10. Click Conditions. If you want the computer to have been idle for a period of time, or to abort shutdown by the computer ceasing to be idle, you can choose the options here.
  11. Under Settings, you should not need to change anything. Click OK.

Now, on your desktop or in your taskbar at the bottom of the screen, you will need the abort icon. Right-click a blank area of the desktop and go to New, Shortcut. In the Target field, type SHUTDOWN -a. Click Next. Type a name (i.e. Abort the missile). Click Finish. Drag this icon to the taskbar or somewhere that you can easily access it. You can also right-click the shortcut, click Properties, and choose a new icon for it.

The advantage of this is that it is all controlled by one program, there is no downloading involved, and it can be implemented anywhere in Windows 7. It will restart as necessary, and won't start up if it's already running.

  • That’s pretty close, but the idle component does not work. If you set the idle condition, the task is never run at all instead of just trying again in 15 minutes. – Synetech Jun 22 '12 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.