Solved

using the taks scheduler to shutdown xp machine

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Can I legally transfer my OEM version of Windows to another PC?  (AKA - Can I put a new systemboard in my OEM PC?) Few of us are both IT and legal experts but we all have our own views of Microsoft's licensing rules and how they apply.  There are…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
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…

861 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