?
Solved

using the taks scheduler to shutdown xp machine

Posted on 2007-11-28
4
Medium Priority
?
550 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 1000 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 1000 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

There are 2 things you must have in order to connect to the internet behind a router, The "Gateway IP" of the router, which is usually something like 192.168.xxx.1, I've seen routers with default values of: 192.168.0.1, 192.168.1.1, 192.168.11.1, …
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
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…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

752 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