Solved

using the taks scheduler to shutdown xp machine

Posted on 2007-11-28
4
547 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If your system is showing symptoms of browser hijacks or 'google search redirects' check out my other article (http://rdsrc.us/u3GP7A) first and run the tool TDSSKiller (http://rdsrc.us/GDBBs4) to get rid of the infection. Once done, and if the …
Sometimes people don't understand why download speed shows differently for Windows than Linux.Specially, this article covers and shows the solution for throughput difference for Windows than a Linux machine. For this, I arranged a test scenario.I…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

749 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