Solved

using the taks scheduler to shutdown xp machine

Posted on 2007-11-28
4
537 Views
Last Modified: 2012-05-05
Hello,

I am trying to use the shutdown.exe command in windows/system32 to shutdown an xp machine. We want to use the task scheduler to shutdown the pc at 2.00 am in the morning everyday. I can add the task into the schedule but it never shuts down. Any ideas how to get this to work - Thanks
0
Comment
Question by:jiveman74
4 Comments
 
LVL 12

Accepted Solution

by:
ibu1 earned 250 total points
ID: 20364551
Open Scheduled Tack
Double-click Add Scheduled Task
Click Next.
 
Under Click the program you want Windows to run, click Browse.
Select Program to Schedule dialog box, locate the %SystemRoot%\System32 folder, locate and click the Shutdown.exe file, and then click Open.
Give any name for the task and how frequently you want this task to run, and then click Next.

Select the time and day you want this task to start, Next.
Type the user name and password
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:
Yyou 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)

Hope it solve your problem
0
 
LVL 17

Expert Comment

by:Shanmuga Sundaram
ID: 20364690
I too sometimes face such issues. I hope that this should be because of Taskscheduler. So I am doing one work around. Better try this. I created one vb script and made it to run everytime when the computer starts. Its very easy to create a vbscript file. Open notepad then copy the below given text and save it as "Filename.vbs"

Dim objShell, strInput
Dim strShutdown
Dim StartTime
strinput = false
do
starttime = left(time,"4")
if starttime = "4:00" then
    strShutdown = "shutdown -s -t 0 -f "
    set objShell = CreateObject("WScript.Shell")
    strinput = True
    objShell.Run strShutdown  
end if
Loop until strInput = True
Wscript.Quit


This works find for me.
0
 
LVL 25

Assisted Solution

by:imitchie
imitchie earned 250 total points
ID: 20364798
add the -f for good measure,
use this command for the scheduled task

shutdown.exe -f -s

you don't really need -t at 2am
0
 

Author Closing Comment

by:jiveman74
ID: 31411387
Hello,
Sorry for the late reply, the shutdown -s switch worked.
Thanks again for all your help
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
When you start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

17 Experts available now in Live!

Get 1:1 Help Now