We help IT Professionals succeed at work.

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

ANGELA11
ANGELA11 asked
on
Medium Priority
211 Views
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.
Angela
Comment
Watch Question

Commented:
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)
CERTIFIED EXPERT

Commented:
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

DL
Commented:
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)

AB

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT

Commented:
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.

DL

Author

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.

Cheers,
Angela
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.