Automatically Shut Down and Power Up Your Computer

I currently have a server that I use as a file server/web server/print server/skype server.  The server is "headless" meaning that it does not have a keyboard, monitor, or mouse connected to it.  I have it connected to the network and sitting on the floor in my office.  For awhile the server stayed on 24 hours a day.  I didn't need it powered up while I was a sleep, so I came up with this simple  shutdown and power up solution.

"Heavy Duty" Outlet Timer    similar to this

Step 1: Restore on AC/Power Loss


Step 2: Setup the Outlet Timer

Setup the start and end times on your outlet timer.  The start time should be set for later than you plan.  So if you want the computer to shut down at 1:00a.m., set the timer for 1:30a.m. The computer will be shutting down on its own with a scheduled tasked.  You do not want the timer to just kill power to the computer while it is running.  More about the scheduled shut down task in the next step.

Step 3: Adding the Shutdown Script

Create a folder on the C: drive called "Scripts".  Navigate to the folder and copy the Run_Shutdown.bat file into the folder. You should now have a Folder on the C: drive called Scripts and a file in that folder called Run_Shutdown.bat. 

Attached is a ZIP file that contains the Run_Shutdown.bat.  Download and un-zip the file.

Step 4: Run_Shutdown.bat As a Scheduled Task

Go to Control Panel and open "Scheduled Tasks". Double Click "Add Scheduled Task" to launch the Scheduled Task Wizard.  Click Next. 

- Click "Browse" and navigate to your "C:\Scripts\Run_Shutdown.bat" file and click Open.
- Choose "Daily" since the outlet timer will be switching on and off every day as well. Click Next.  
- Choose what time you wish for the shutdown to start.  For my setup I chose 1:00a.m. and Every Day. Click Next.
- Enter the password for the administrator account.  Click Next
- Click Finish to save our Scheduled Task.

You will now see Run_Shutdown in your list of scheduled tasks.  To test the script you can right click on the Run_Shutdown task and choose "Run".  If everything is working, your computer will shutdown in 30 seconds. You will obviously have to press the power button on your PC to power the system back up.

Step 5: What Did You Just Do?

What you did was create a task that shuts down your computer at a scheduled time.  The outlet timer then completely kills power to the PC shortly after.  (kind of like pulling the plug on the computer after it has shut down).  Once the outlet timer turns on, the computers BIOS is set to Restore on AC/Power Loss...powering on your system.  The computer sees this as a safe shutdown and power up.  You should not get any power interruption errors on your screen when the computer boots up.

I have my computer/server setup to shutdown at 1:00a.m. The outlet timer shuts down at 1:30a.m. then turns on at 7:00a.m.  I figure that this will help save energy and reduce the chances of the system getting hacked.



    • Sensors Contest

      Sensors Contest
    • DIY Summer Camp Contest

      DIY Summer Camp Contest
    • Backyard Contest

      Backyard Contest

    7 Discussions


    2 years ago

    Wow you don't know what "code" means as there is no code involved. Its just enabling the option in a setting menu.


    2 years ago


    Thanks to you now I have.

    Great work :)

    And to dwjp90



    Hope this helps :)


    9 years ago on Introduction



    Good instructible overall though.

    2 replies

    Reply 7 years ago on Introduction

    So far the server has been setup this way for over a year now. No issues. The computer is not "Power Cycling" since it runs a proper shut down script to power off. Powering on, with the "AC Power Loss feature" is no different then hitting the power button in my opinion. Wake on LAN requires another computer to initiate the power up. With this set up, I can be at work and get to my web sites, web apps and files without having to wake up the computer first.

    Callum Snowdendwjp90

    Reply 7 years ago on Introduction
