Schedule Windows server to reboot or shutdown automatically

Sometime it is necessary to reboot (or shutdown) windows server. Under UNIX or Linux you can use reboot / hal t/shutdown command via cron jobs or at command. But, when it comes to Windows server there is no built in command exist. Only Windows 2000 Resource Kit offers shutdown command line utility.

However, sysinternals has nifty utility called PsShutdown. It is a command-line utility similar to the shutdown utility from the Windows 2000 Resource Kit, but with the ability to do much more. In addition to supporting the same options for shutting down or rebooting the local or a remote computer, PsShutdown can logoff the console user or lock the console (locking requires Windows 2000 or higher). PsShutdown requires no manual installation of client software.

How do I schedule Windows Server Reboot / Shutdown?

You can download PsShutdown from sysinternals web site.

Store file on Windows server in folder. I use folder called C:\admutils. Next open windows command prompt (Start > Run > cmd) and use windows at command to schedule reboot:
c:> at 2:00am c:\admutils\psshutdown.exe -r -f -c -t 10
Above command will reboot system at 2am. If you want to shutdown system:
c:> at 1:00am c:\admutils\psshutdown.exe -s -f -c -t 10

  • -s: Shutdown windows server
  • -r: Reboot windows server
  • -f: Forces all running application to exit
  • -c: Allow the shutdown to by cancel by user
  • -t: Specifies the countdown in seconds until the shutdown

For more information read official psshutdown documentation. Read at command help by typing at /? command.

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
57 comments… add one
  • Manju Jan 24, 2014 @ 5:35


    thank you all for giving useful info but the thing is i am using windows server 2008 32-bit. I don’t want to restart or shutdown server but it is automatically restarting daily at same time no logs, error records. Still i am unable to find that reason for daily same time restarting. How to find or edit exact task if it is any task is scheduled?
    please guide me to solve this issue

    Thank You

  • Girish Sep 5, 2013 @ 13:08

    better to create a .bat for scheduled restart and put it into startup which will keep on releasing command for every startup for next restart.

  • Julius A. Woodson Dec 12, 2012 @ 16:14

    Thanks Vevek, I try the auto shutdown script and it work well. thanks for the info once aagain it was cool.

  • Abhilash Sep 27, 2012 @ 9:30

    HI Evreybody,
    I have four windows server 2003 , I want to reboot this servers one by one automatically with a timedelay after power came. Any one Please give the solution for this…!

  • Terry Aug 30, 2012 @ 19:09

    Sysinternals tools are now available here from Microsoft:

  • Mohammad May 1, 2012 @ 6:31

    the best way is to scheduled tasks option in control panel!

  • Akeem Mar 12, 2012 @ 18:49


    Page Not Found

    We’re sorry, but the page you requested could not be found. Please check your typing and try again,
    or use the search options on this page.

  • antodominic@techiesniffer Aug 20, 2011 @ 12:34

    Why certain taks needs the server to rebooted…can u share y….

  • kadesh Aug 12, 2011 @ 13:15

    How to Set a Timer for Automatic Shutdown
    Setting up a timer for automatic shutdown is no big deal, in fact many people would already know about it, but if you don’t, read on.

    There is no software to install and no tweaks to be made. An automatic shutdown is inbuilt into Windows and ready to be explored. Let’s check out how we can set a timer for automatic shutdown.

    Right click on the desktop. Select New → Shortcut.
    A New Shortcut dialog box will appear.
    In the location box, this is how you will enter the details: shutdown.exe is for calling the shutdown executable. –s is the command for shutdown. –f is for performing a forced shutdown. If an application stops responding when shutting down, this command will force shut it. Using this command is not compulsory, but recommended. And next, the –t command is for specifying the time the shutdown will take place. After you put the –t command give a space and then enter the time in seconds. So in the above example, the computer will be shut down in 6 hours. Let’s put the whole

    command in one line:shutdown.exe -s -f -t seconds

    Click next and the shortcut will be created on the desktop. Give it a name and click it whenever you wish to initiate an automatic shutdown. If you want to change the time, right click on the shortcut, select properties and change the time from the dialog that opens.
    Tip: This command can also be initiated from the Run box or CMD.

    Tip 2: If you want to display a message that displays when the countdown is in progress, you can append a –c command with a message attached. Like this:
    -c “Computer is shutting down”

  • kadesh Aug 12, 2011 @ 13:10


    Thank you all for giving lot of info

  • Norm Mar 15, 2011 @ 9:51

    Matti you pompous ASS!

  • William Mar 4, 2011 @ 14:30

    This has worked for me for different machines:
    “Reboot the current computer at 10:00pm, with a 180-second warning dialog for anyone logged in.”
    at 22:00 shutdown /r /t 180

    “/r” = reboot
    “/t” = timer

  • AD Jul 22, 2010 @ 11:14

    I just want to know that what should be the best practise for the server machines mean that would it be better to shutdown and start the server on daily basis or keep them on for 24 hours

  • lhenry Apr 23, 2010 @ 8:59

    it does not surpise me a windoz server has regualar reboot needs .. ahahah

  • Matti Mar 2, 2010 @ 21:54

    Well if you weren’t a tool…..
    you would just use windows built in utility without having to download 3rd party software.

    c:windowssystem32shutdown.exe -r -t 600 -f -m \%computername% -d P:0:0 -c “Planned system reboot”



    • Kevin Mar 16, 2012 @ 18:43

      Matti, are you the admin that the Bastard Operator From Hell was based off?

  • Aziz Jan 10, 2010 @ 6:43

    Hi there
    i have a problem that how can i give a time for server 2003 to start automaticaly.
    please help me.

  • Brad Nov 23, 2009 @ 13:52

    So Dan are you saying that the
    /accepteula switch mentioned numerous
    times above is not enough and that the
    registry key needs to be changed/created?

  • Dan Sep 15, 2009 @ 18:26

    The latest version of PSShutdown pops up a license agreement which has to be accepted. Unfortunately, this has to be accepted on a per-user basis, even when running under the SYSTEM account. You’ll know it is waiting for the EULA to be accepted when you see PSShutdown.exe running forever.

    To work around this problem, you can add an entry to the SYSTEM account’s registry indicating that you have accepted the EULA. Go to the key at HKEY_USERSS-1-5-18SoftwareSysinternalsPsShutdown. Create it if it doesn’t exist (it should be there if you tried running it once before). Add a new DWORD value called EulaAccepted. Set this value to 1. Now you can schedule the task to run as described above and it will work.

  • Venomhed Aug 24, 2009 @ 19:38

    Guys SHUTDOWN.EXE does NOT work under a Scheduled Task without a user logged in so please stop posting that it does.

    PSShutdown DOES work as a scheduled task with no user logged in.

    There is a difference, read and test before posting as to avoid confusion here.

    • chairuou May 5, 2011 @ 4:44

      There is an option in configure dialog to set it run with out logged in account.


    • shane Mar 16, 2012 @ 17:00

      You can schedule psshutdown.exe via a scheduled task. I don’t mean to be rude but don’t be so snooty if your just not informed. I use pstools as a scheduled reboot for years.

  • Gazzaman22 Jun 26, 2009 @ 14:22

    Can any tell me and explain how to reboot windows 2000 server frequently
    using this or another method

  • uddika Apr 17, 2009 @ 3:56

    nice work guys, thanks v much

  • josh Jan 22, 2009 @ 7:13

    there is a shutdown command on windows 2003 which is used like
    shutdown /t 00 /r
    meaning shutdown in 00 seconds , reboot, to shutdown instead of reboot simply use /s, to force use /f

    on winxp this tool exists but uses dashes ie
    shutdown -t 00 -r

    if your looking to startup a box, check your bios for auto power on scheduling. or use a scheduleld wake on lan from another system.

  • sampath kumar Oct 23, 2008 @ 5:34

    My situation is different

    I have server one is win2k3. I finished setting inthe scheduled task to shutdown the machine at 8.30 pm. Actually now what i want is my server win2k3 should switched on in the morning 8 am without manually switched on.

    automatically how to make it ?

    I tried but i could not succeed

    Please write and explain simple way

  • Ken Wallewein Sep 7, 2008 @ 17:50

    Couple of comments on stopping services.
    – It makes no sense to use an “at” command in a batch script. The script itself needs to be scheduled.
    – It may be that the amount of time Windows allows for shutting down services needs to be extended. There’s a registry parameter for that; don’t remember where, offhand.

    And one comment on scheduled tasks in general:
    I like to have anything like this write to a log file so I see the record of what the command(s) did. Not a big fan of mysteries when it comes to server admin.

  • jw Jun 14, 2008 @ 15:11

    thanks for the info, very usefull!
    My boss asked me to write a script to shut down the entire serverpark at work, in case of emergencies. I want to make a netstop script for shutting down several services quickly, to make sure the servers dont take too long to shutdown. As there are some exchange services that can give you a hard time when you ask them to shutdown for example. So i not only need to make these net stop scripts for exchange, but also for SQL, ISA and IIS servers. So if anyone of you familiar with scripting and services can help me .. it will be greatly appreciated! The best way to contact me is mailing me on “”. I hope to get some feedback, i really need these scripts. Thanks in advance!

  • 🐧 nixCraft Jun 6, 2008 @ 19:31


    You need to write a small batch file. To stop service use net stop service command. May be something as follows will do the trick:

    net stop "service name"
    net stop "service name2"
    at 1:00am c:admutilspsshutdown.exe -s -f -c -t 


  • Matt Jun 6, 2008 @ 19:06

    I’m looking for a way if possible of using the shutdown command or psshutdown command to restart a windows server 2003 without it causing services like exchange etc to report errors in event log of it not closing correctly and server logs reporting that the server shutdown unexpectedly, as this can lead diagnosing problems astray. Obviously the fact that it forces services to close mid operation is the problem – would the t switch fix this giving services enough time to stop or does it not start closing things until the time is up… I guess worse case is to run a stop command for services having a problem but it would be nice if there is just a simple switch for it

  • JP Jun 4, 2008 @ 9:33

    My situation is some what different

    I have server one is win2k3 and other is linux RH AS4 . what i want is both server should switched on morning 8 am and should shutdown 12 pm automatically how to make it ?

    I tried but i could not succeed

    Please write and explain simple way

  • AD108 May 27, 2008 @ 12:10

    /accepteula works with latest ver. of psshutdown.
    Would also recommend psshutdown over Windows shutdown.exe
    Open Notepad, paste the command below
    psshutdown -r -f -c -t 10 /accepteula
    then save as autoreboot.bat
    Next create Windows scheduled task to run this batch file. Can download psshutdown.exe from sysinterals site and place in system32.

  • Joe H May 9, 2008 @ 19:55

    You can also do this through Scheduled Tasks. Go to Control Panel->Scheduled Tasks->Add Task. Select Browse and go to %Windows%System32 and select shutdown.exe. You can then follow the wizard to select how often and at what time. You’ll need to provide account login info that has admin privileges on the machine. At end select the option to display advanced properties. Under the Task pane you’ll see it is going to run C:WINDOWSsystem32shutdown.exe. You can add the /r option to restart – or any other you may need such as /t 60 to wait 60 seconds before restarting.

  • Andy duncan Dec 29, 2007 @ 3:45

    My mistake i had to update to the latest version of the tool once i did that the -accepteula worked fine

  • Andy Duncan Dec 28, 2007 @ 12:59

    I tried it with the accepteula switch and it still did not work……………….I am using windows 2003 server and R2

  • Rod Jun 14, 2007 @ 7:35

    Works great with -accepteula, thanks

  • cornel panceac May 25, 2007 @ 18:05

    testing today the command, i’ve found that -accepteula is not a supported parameter on recent version of psshutdown, as jeff smith pointed earlier

  • cornel panceac May 25, 2007 @ 10:48

    for the ones who wonder, it looks like ‘scheduled tasks’ is just a frontend to at, so if you wanna schedule some tasks, you can also use at /? to find out how 🙂
    of course you’ll find out that entering just
    will display the current jobs
    at /delete
    will delete the thing and so forth 🙂
    happy hacking 2 all 🙂

  • Jeff Smith May 14, 2007 @ 12:33

    yea thanks-I found that….im just being thick.monday morning hang over :).thanks

  • 🐧 nixCraft May 14, 2007 @ 12:02

    Use the task scheduler in Windows 2000/2003 server by visiting My Comp > Control Panel > Scheduled Tasks


  • Jeff Smith May 14, 2007 @ 11:09

    There is no need to reponde to my 1st message, I never saw the add -accepteula part. It now seems to work. Blindin, thanks. Can I get some script to make this run daily, without any manual intervention.

  • Jeff Smith May 14, 2007 @ 10:59

    PS: how can I view these said jobs as well? I now apparently have 3 jobs pending.thanks. J

  • Jeff Smith May 14, 2007 @ 10:58

    a’noon everyone.I am running, win server2003. I have tried… the above. and it does nto work for me-I must be doing something wrong. I have typed the following. in the cmd prompt. C:>at 11:45am c:pstoolspsshutdown.exe -r -f -c -t 10
    I press enter and I get the following message. “Added a new job with job ID = 1”
    NOTHING happens….at the said time…!!!! what am I missing? the official documentation, states that I have to put in the comp name? is this what I am missing???? please help. many thanks, J

  • Les W Apr 24, 2007 @ 13:05

    Thank you. A very usful bit of information, just what the doctor ordered.

  • Mani G Apr 15, 2007 @ 13:40

    Nice article.. It has helped me a lot. Thank you.

  • 🐧 nixCraft Apr 11, 2007 @ 14:31


    Use windows schedule task option and select weekly option.

  • Dan Apr 10, 2007 @ 19:42

    What switch do I need to do a weekly restart?

  • Weenie Mar 6, 2007 @ 12:28

    great. I was experiencing problem with shutdown built-in command.
    just discovered this website, looks very interresting.

  • TimBee Jan 18, 2007 @ 8:45

    NixCraft -> Thank YOU for this helpful article! 🙂

  • 🐧 nixCraft Jan 17, 2007 @ 22:21


    Thanks for pointing out this issue.

    Appreciate your post.

  • TimBee Jan 17, 2007 @ 14:02

    You should also add the command “-accepteula” to the psshutdown command, because otherwise the task will hang, idicating a “running” state in Scheduled Tasks. It’s just waiting for the EULA agreement, which it doesn’t show.

    So, to complete the example before, type:

    “at 2:00am c:admutilspsshutdown.exe -r -f -c -t 10 -accepteula”.

    • sediq Feb 18, 2014 @ 5:24

      Hey there,

      I tried all possible ways, one the scheduled time comes, a command line appears and disappears fast enough that could not be read, please let me know, how to Schedule shutdown on server, i have the psshutdown.exe, tooo

      • Chi Feb 25, 2014 @ 4:32

        Why don;t you just make a batch file.
        ex. shutdown.bat
        the command “shutdown.exe /f”
        and make a schedule task for that batch file.
        And to see the command line, just try to open a command prompt window, and type your commands.

        • Chi Feb 26, 2014 @ 6:58

          My mistake, can’t use my method, please use psshutdown.exe -s -f -c -t 10 instead and configure it on your scheduler.

  • Anonymous Sep 13, 2006 @ 21:17

    Ok I will try reading the post next time

  • Anonymous Sep 13, 2006 @ 21:16

    Windows server already includes a shutdown command called just shutdown!

  • Anonymous May 26, 2006 @ 13:52

    Excellent information, I thought you guys only likes UNIX / Linux 😉

    Keep it up good work.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @