Solved

using the taks scheduler to shutdown xp machine

Posted on 2007-11-28
4
538 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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Issue: Unstable cursor in Windows XP and Windows runs extremely slow in that any click will bring up the Hour glass (sometimes for several seconds before giving you what you want) . Troubleshooting Process and the FINAL FIX: This issue see…
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…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

11 Experts available now in Live!

Get 1:1 Help Now