Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

Sheduled daily reboot in WIndows 7 only runs once

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
Jeff swicegood
Asked:
Jeff swicegood
  • 12
  • 6
  • 5
  • +4
3 Solutions
 
10023Web site maintenance and designCommented:
Just a thought...is your system clock accurate??
0
 
sumeshbnrCommented:
Have you selected 'One time only' when creating this task?
0
 
David Johnson, CD, MVPOwnerCommented:
In the triggers is is set to run daily?
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
sumeshbnrCommented:
check the run if logged on  option too (have you checked)
0
 
Jeff swicegoodTechnicianAuthor Commented:
Yes, my trigger page looks exactly like the picture.
System Clock is Right
Run only when user logged on is checked
0
 
Jeff swicegoodTechnicianAuthor Commented:
After the task executes and the computer reboots, the Next Run TIme field is blank.
0
 
VB ITSSpecialist ConsultantCommented:
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 -rOK > test the task again.
0
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
McKnifeCommented:
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
 
VB ITSSpecialist ConsultantCommented:
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
 
McKnifeCommented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
David Johnson, CD, MVPOwnerCommented:
Reboot                                   11/30/2014 2:03:02 PM  Ready
Reboot test                              Disabled



So we will know at 2PM tomorrow  (30 Nov)
0
 
McKnifeCommented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
VB ITSSpecialist ConsultantCommented:
Are you still receiving the "Selected Task "(0)" not longer exists" and "Catastrophic failure" error messages though?
0
 
Jeff swicegoodTechnicianAuthor Commented:
Yes. How do I track down which task(s) are corrupted?
0
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
McKnifeCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
@lionelmm:  This computer is not  part of a domain.

@McKnife: I receive no errors when opening the library.
0
 
McKnifeCommented:
ok... but "Also when I click "Display all running tasks" I ger the error "Catastrophic Failure" persists?
0
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
McKnifeCommented:
Now try again with the system account.
0
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
VB ITSSpecialist ConsultantCommented:
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
 
Lionel MMSmall Business IT ConsultantCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
VB ITSSpecialist ConsultantCommented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
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
 
Jeff swicegoodTechnicianAuthor Commented:
Thank you all  very much! It's working without a hitch.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 12
  • 6
  • 5
  • +4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now