Solved

Sheduled daily reboot in WIndows 7 only runs once

Posted on 2014-11-28
33
277 Views
Last Modified: 2014-12-05
Hi,

I am trying to shedule a daily reboot on a WIndows 7 64bit machine.

I have setup my task in task manager. The PC reboots at the scheluled time the first time only, and then never reboots again. There is no message I can see about the task failing.

I created a file called reboot.bat  tha contians "shutdown /r" and then set it to run daily. When I run it manually through task manager it runs.

I have tried running taksmanager for setting up the task as both administrator and regular user. Seems to make no difference.
0
Comment
Question by:Jeff swicegood
  • 12
  • 6
  • 5
  • +4
33 Comments
 
LVL 10

Expert Comment

by:10023
ID: 40471065
Just a thought...is your system clock accurate??
0
 
LVL 11

Expert Comment

by:sumeshbnr
ID: 40471084
Have you selected 'One time only' when creating this task?
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40471120
In the triggers is is set to run daily?
0
 
LVL 11

Expert Comment

by:sumeshbnr
ID: 40471123
check the run if logged on  option too (have you checked)
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40471135
Yes, my trigger page looks exactly like the picture.
System Clock is Right
Run only when user logged on is checked
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40471148
After the task executes and the computer reboots, the Next Run TIme field is blank.
0
 
LVL 24

Expert Comment

by:VB ITS
ID: 40471540
Is there a particular reason you created a batch file to perform the reboot command instead of just specifying the shutdown.exe command in the Actions tab?

In the Actions tab of your task, remove the existing entry for the batch file then click on New > select Start a program from the Action drop down > in the Program/script box type in shutdown.exe > in the Add arguments (optional) field type in -r > OK > test the task again.
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40471554
I tried it both ways. Same thing happens.

More info: When I first start the task sheduler I get the error: "Selected Task "(0)" not longer exists. To see the current task click Refresh".

When I hit refresh the errror pops up again.

Also when I click "Display all running tasks" I ger the error "Catastrophic Failure (Exception from HRESULT 0x8000FFFF (E_UNEXPECTED)
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40471557
Jeff, simply take the account "system" as executioner and all will be good.

My guess about the "why is this happening" (just a guess): you are on a domain. The default domain policy sets who has the privilege to run as a batch job (that is a user privilege required for scheduled tasks!). Whenever you setup that task, the account you chose was granted that privilege but after a reboot, a policy refresh occurs and overwrites that setting, rendering the task broken. Have seen that "problem" millions of times.

If that's not it, please look at the history tab of that task, that's like a log file.
0
 
LVL 24

Assisted Solution

by:VB ITS
VB ITS earned 225 total points
ID: 40471562
Run sfc /scannow and chkdsk /f /r in an elevated command prompt first to rule out system corruption, then post back here with your results. The "Selected Task "(0)" not longer exists" and "Catastrophic Failure" error messages are usually related to corrupted registry entries or corrupted task .xml files.
0
 
LVL 53

Accepted Solution

by:
McKnife earned 225 total points
ID: 40471567
True, those message do indicate task file corruption. Those can be solved by eliminating the task files and registry entries, I did that before. But I vote first for using the system account as the symptoms ("works - after a reboot no longer") point in that direction.
0
 
LVL 24

Assisted Solution

by:lionelmm
lionelmm earned 50 total points
ID: 40471583
please run schtasks /query from command prompt and post the result for us to see.
You can then also run this from a command prompt to create the scheduled task
SCHTASKS /create /tn "Name of your Task" /tr "c:\Windows\shutdown.exe -f -r -t 60" /sc daily /sd 11/29/2014 /st 17:00
That will create a new task to run daily at 5PM (17:00). The system with restart (-r) in 60 seconds (- t 60)
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40472150
Surprisingly, setting system as the executor did not work. Here are the tests I have run.

PS C:\Windows\system32> sfc /scannow

Beginning system scan.  This process will take some time.

Beginning verification phase of system scan.
Verification 100% complete.

Windows Resource Protection did not find any integrity violations.

Open in new window


Output of tasks query
schtasks-query.txt

I did not run chkdsk yet, as I only have remote access late a night.

I did insert another task with your command line.
0
 
LVL 78

Expert Comment

by:David Johnson, CD, MVP
ID: 40472156
Reboot                                   11/30/2014 2:03:02 PM  Ready
Reboot test                              Disabled



So we will know at 2PM tomorrow  (30 Nov)
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40472394
Some notes: your output file talks about insufficient access permissions - you did not execute it elevated, right? run cmd.exe elevated and un it again.
->sfc and checkdisk would not repair tasks. Task corruption as indicated by "catastrophic failure" can be undone by locating corrupt tasks, deleting their files and registry entries and recreating them.

Then: what about the history tab I mentioned, what does it say?
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 40472437
Folder: \MyTasks
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
Reboot                                   11/30/2014 2:03:02 PM  Ready
Reboot test                              Disabled

Which one of these two tasks is the one that is failing and is one of these the one you added with SCHTASKS?
0
Do email signature updates give you a headache?

Do you feel like you are constantly making changes to email signatures? Are the images not formatting how you want them to? Want high-quality HTML signatures on all devices, including on mobiles and Macs? Then, let Exclaimer solve all your email signature problems today.

 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40472969
Yes I did run it with elevated privledges. Just to be sure I ran the query again as admin and the output is the same, with the messages about not having the access level.

@lionelmm Here are the pertinent part of the the updated schtasks query after adding your new task with SHCTASKS.

I forgot to change the task name so it remained "Name of Your Task"

Folder: \
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
Name of your Task                 N/A                             Ready

Folder: \MyTasks
TaskName                                 Next Run Time          Status
======================================== ====================== ===============
Reboot                                   N/A                                 Ready
Reboot test                              Disabled

All these fail after completing once.

The history tab just shows that the tasks completed successfully.
0
 
LVL 24

Expert Comment

by:VB ITS
ID: 40472972
Are you still receiving the "Selected Task "(0)" not longer exists" and "Catastrophic failure" error messages though?
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40472997
Yes. How do I track down which task(s) are corrupted?
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 40473133
ok there seems to be something amiss here--it is not showing the run time--did it run the first time? Try this for me, where the user (/RU) is a domain admin
SCHTASKS /create /tn "Testing Reboot PC" /tr "c:\Windows\shutdown.exe -f -r -t 60" /sc daily /sd 11/29/2014 /st 17:00 /RU runasuser /RP userpassword
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40473148
Ok, if you ran the schtasks-command elevated, maybe there are tasks only accessible by the system account. Anyway, to find out what tasks are corrupted, you start task scheduler, open the task library and (hopefully) you will receive error messages. Because at that time all tasks are parsed, errors would be found and corrupted tasks would be named - normally.
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40473808
@lionelmm:  This computer is not  part of a domain.

@McKnife: I receive no errors when opening the library.
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40473823
ok... but "Also when I click "Display all running tasks" I ger the error "Catastrophic Failure" persists?
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 40474032
then use SCHTASKS /create /tn "Testing Reboot PC" /tr "c:\Windows\shutdown.exe -f -r -t 60" /sc daily /sd 11/29/2014 /st 17:00 /U runasuser /P userpassword
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40474612
I just followed a guide on how to remove all taks and registry keys for tasks and recreate them all. I left quite a few useless ones out. I recreated only the Microsoft ones. Now I get no Catastophic or  "Selected Task (0)" Errors.

Unfortunately, my reboot task will not even run manually through task scheduler now. I get err.txt
0
 
LVL 53

Expert Comment

by:McKnife
ID: 40474617
Now try again with the system account.
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40474653
Ok. Setting the user to "system" fixed that-- and it appears to be working! The next ron time field displays what it should. I will test it for a couple days
0
 
LVL 24

Expert Comment

by:VB ITS
ID: 40474672
Not sure why you had to set the user to SYSTEM to get it to run properly, I create Scheduled Tasks all the time to reboot servers and I've never had to set it to run as the SYSTEM account. At least it's working now though.

In the properties of the task, do you have the following options selected?
Run whether user is logged on or not
Tick Do not store password. The task will only have access to local computer resources.
Tick Run with highest privileges
Configure for: Windows 8.1
0
 
LVL 24

Expert Comment

by:lionelmm
ID: 40474750
Where are your scripts located? Where is this "\MyTasks\Reboot Task". I would expect to see C:\MyTasks\Reboot Task.bat so why is it only "\MyTasks\Reboot Task" for location of the script
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40474790
I think what's lisited in query are names and folders strictly internal to task scheduler. I only had the one batch file in the root directory  and I got rid of it anyway in favor of your command line, and the approach therein.

@McKnife: FYI the culprits, corrupted tasks were two AVG Free Updaters. And it told me which ones were corrupt when I did schtasks /query /fo CSV > tasklist.csv.

@VB_ITS: Maybe something got messed up with it's credentials or memory of passwords. Although I never even set a password prior to this.
0
 
LVL 24

Expert Comment

by:VB ITS
ID: 40474801
See how you go with the task as it is. Are you able to confirm if the options in my previous post are selected/ticked?
0
 
LVL 1

Author Comment

by:Jeff swicegood
ID: 40475044
Yes, they are tiked. Of course Run whether user is logged on or not is greyed out as well as Do not store password. The task will only have access to local computer resources.

Also this is Windows 7.

Run with highest privileges is tiked.
0
 
LVL 1

Author Closing Comment

by:Jeff swicegood
ID: 40484102
Thank you all  very much! It's working without a hitch.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

747 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

12 Experts available now in Live!

Get 1:1 Help Now