• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 200
  • Last Modified:

Schedule a Windows XP machine to Reboot every day and also to print a certain file at a certain time each day

Hi Folks,

I need you help and advice.

I have a machine that i need to reboot (Windows XP) at midnight every night how can i schedule this task.

I also need to send a file to the printer at a certain time each day from the same machine.

Thank you in advance for your help.
1 Solution
Click Start, Run and type control schedtasks
Double-click Add Scheduled Task. The Scheduled Task Wizard starts.
Click Next.
Under Click the program you want Windows to run, click Browse.
In the Select Program to Schedule dialog box, locate the %SystemRoot%\System32 folder, locate and click the Shutdown.exe file, and then click Open.
Under Perform this task, specify a name for the task and how frequently you want this task to run, and then click Next.
Under Select the time and day you want this task to start, specify a start time and date for the task, and then click Next.
Type the user name and password to run this task under, and then click Next.
Click to select the Open advanced properties for this task when I click Finish check box, and then click Finish.
Click the Task tab. In the Run box, specify any additional parameters that you want to use with Shutdown.exe. Click OK.
Important: In the 10th step, you need to add the parameters for the Shutdown.exe command. To immediately shutdown the system (0 second timeout), the command-line would be:

shutdown.exe -s -t 00

To reboot the system immediately, this command:

shutdown.exe -r -t 00

For additional help, type Shutdown /? at the Command Prompt. Scheduling the Shutdown.exe without any parameters will not help. It will just execute with a exit code 0 (success)
I'd follow the above, but would create a batch file running the shutdown -r cmd, this would then be selected when setting up the scheduled task.  You can do the same with the print cmd -specify the file you want to print and enter the syntax into a batch file and schedule the task above.

To create a batch file= open note pad > enter syntax = shutdown -r > save as > "C:\shutdown.bat".  The C represents your drive letter, so change accordingly.  Ensure to put in the speech marks as otherwise it will save as a .txt file.  
For the print command follow the same procedure, but in the text file enter
                      Print /D:[device name] drive:path and filename

A faster alternative is to go the command prompt and type
C:\shutdown -t xx
where xx is how long you want the PC to stay before shutting down (xx is in seonds)


Just to confirm a point - the shutdown command shutdown -r has a shutdown warning period of 30secs by default.  Applying the shutdown -t xx command is only necessary if you require an alternative to that default time.  As I understand the question you want to run schedules for when you are not there, therefore the -t command is not essential.

ANGELA11Author Commented:
Hi All,

thank you for you help it has been really great.
I just can't seem to get the print batch file working.
I created the batchfile with the commands Print /D:[device name] drive:path and filename
However it just won't run for me.

Any help would be great that you can give me.


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now