How to Auto Shutdown The Computer After a Scheduled Task Is Complete
- 1). Schedule the task that you want to run using the "Scheduled Tasks Wizard." Open the Control Panel and double-click on "Scheduled Tasks." Double Click the "Add Scheduled Task" icon to start the Scheduled Task Wizard. Follow the on-screen prompts given by the wizard to schedule the time and frequency that you want the task to run. Note carefully the time and frequency because you will need it in the next step.
- 2). Create a scheduled Shutdown task to shut the machine down. Start the Add Selected Task Wizard again. On the second screen of the wizard, you will be asked to select the program to run. Click the "Browse" button and navigate to the %SystemRoot%\System32 folder (in most cases this is C:\Windows\System32). Select "Shutdown.exe" and click "Open." Finish the wizard, specifying the same time and frequency you used for the first scheduled task you created. At the end of the wizard, click the "Open advanced properties for this task when I click Finish" check box.
- 3). When the Advanced Properties dialog opens, set the advanced properties to indicate that the scheduled Shutdown task should wait until the computer is idle. Click on the "Settings" tab. In the "Idle Time" box, tick the check box labeled "Only start the task if the computer has been idle for at least:" Enter 1 minute for the time and then enter 999 minutes in the "retry for up to" field. Make sure the "Stop the task if the computer ceases to be idle" check box is not checked. In the "Power Management" box, tick the check boxes that are appropriate for your situation. Click the "OK" button to save your settings for the scheduled Shutdown task.
Source...