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

Posted on 2006-03-31
Last Modified: 2008-02-01
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.
Question by:ANGELA11
    LVL 8

    Expert Comment

    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)
    LVL 12

    Expert Comment

    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

    LVL 5

    Accepted Solution

    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)


    LVL 12

    Expert Comment

    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.


    Author Comment

    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

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
    I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now