Windows 7 and 8 shutdown batch file to save electricity

Hi Everyone,

If you are like me you work on your computer or use it to play games in the evening to alleviate stress. However, once you are finished using the computer you forget to turn if off. Now, for many this does not seem to be a problem but consider other aspects of leaving a computer running.

  1. Someone could gain access to a laptop webcam and see that no one is home or spy on people in the room.
  2. If you accidentally get a virus the PC which can turn it into a zombie or join it to a botnet. So while you are away your PC is working in the background.
  3. Some people just never turn the PC or laptop off because he or she feels the power saving options are sufficient.
  4. The amount that all the electronic devices are costing you per month in your electric bill.

Let’s examine the fourth possibility because it happened to me. My average electric bill when my kids were at home was $125 per month. When they left for college the electric bill dropped to $95 per month. When I deployed the shutdown script on my PC the electric bill dropped to $69 per month. Saving over $50 a month (you could save more) on your electric bill seems like a pretty good idea to me.

The concept is quite simple. Create a shut down batch file that Window Task Scheduler runs each day at a certain time when users are not on the PC or laptop. Here are the steps.

  1. Open Notepad using the Windows menu or typing Notepad in the search box.
  2. Within Notepad type the following: shutdown /s
  3. Save the Notepad document as Shutdown.bat to the C: drive using the menu FileSave As… – select the C: drive and give the file a name like shutdown.bat and click Save. Now, open the C: drive to look at the file. It should show a picture with a couple gears. If it does not that is because there is a .txt extension on the file. To change do the following:
    • Open Windows Explorer by running from the search box explorer.exe and select the C: drive. Select OrganizeFolder and search optionsView tab
    • Unselect the Hide extensions for known file types and click OK.
    • The Shutdown.bat file will be named Shutdown.bat.txt.
    • Right click on the file and select rename, delete the .txt extension and click OK for the warning about changing a file type.
  4. Open Task Scheduler by going to AccessoriesSystem ToolsTask Scheduler or by running taskschd.msc in a search window.
  5. Select Create Basic Task…TaskScheduler
  6. Give the task a name. Make the name and description motivational if you like and click Next.task_name
  7. For the task trigger select Daily and click Next. If you only want the PC or laptop to shut down during week days select Weekly and click Next. I use weekly because of projects and other things I am working on during the weekend.Daily
  8. Select the time for the task to run each day. If you selected Weekly in step 7 you will also have to select the days of the week for the event to trigger.  Most people have gone to work or school by 8 a.m. so that is the time I set here. Click Next8AM_Daily
  9. For the action select Start a program and click Next.Run_a_script
  10. On the Start a program tile click Browse… and find the Shutdown.bat file and click Next.
  11. On the Summary page you will see the task, select Open the Properties dialog for this task when I click Finish and click Finish
  12. On the General tab select Run whether the user is logged in or not, check Do not store password. The task will only have access to local resources and check Run with the highest privileges. Click OK. If prompted for a user name and password you will need to provide an administrator user and password.

That is all there is to it. Hopefully you can save some money on your electric bill and keep predators off your webcam. If you have multiple Windows 7 and 8 PCs and laptops you can actual highlight the task in Task Scheduler, click Export and Windows will create an XML file that you can place on another PC and within Task Scheduler, click Import and browse to the XML file. You might need to change the user the task runs as since most users do not have administrator permissions on another PC.

Comments are closed.