Windows Update stuck in Stage 3 restart loop

Windows Update stuck in Stage 3 restart loop

I have install windows updates yet the server keep say “update stage 3 of 3 0%” and then reboot itself. This goes on in a loop.

To solve this do the following:

  1. Boot the server with ERD commander disk.
  2. Open CMD.
  3. Run command takeown /f C:\Windows\winsxs\pending.xml
  4. Rename the c:\windows\winsxs\pending.xml with command Ren c:\windows\winsxs\pending.xml pending.old
  5. Reboot the server

How to Restart FortiGate Services

How to Restart FortiGate Services

When browsing to the forfIgate GUI I got response “error 400”

I restated the httpsd on the fortIgate to solve the issue.

To restart the httpsd do the following:

  1. Login to the fortIgate using ssh and admIn user
  2. Run the command get system performance top
  3. Press ctrl+c to stop the command.
  4. Locate the httpsd and its process Id. the process Ids are on the second column from the left.
  5. Run the command dIag sys kIll 11 <process-Id>
  6. Try to brows again to the GUI.

Example:

Run Time:  45 days, 18 hours and 50 minutes

0U, 0S, 100I; 4031T, 2260F, 149KF

miglogd       44      S       0.1     0.4

proxyworker       52      S       0.0     1.0

proxyworker       53      S       0.0     1.0

httpsd       66      S       0.0     0.8

httpsd      126      S       0.0     0.7

ipsengine       60      S <     0.0     0.6

ipsengine       72      S <     0.0     0.6

How to fix Task Scheduler error: The task image is corrupt or has been tampered with

Known issue 1

After you install this security update, you may receive an error message that resembles the following when you open Task Scheduler (taskschd.msc):

Task taskname: The task image is corrupt or has been tampered with.

Specifically, this problem can occur in the following scenario:

  1. Your computer is running Windows Vista or Windows Server 2008.
  2. You install security update 2305420.
  3. You upgrade to the release version (RTM) of Windows 7 or Windows Server 2008 R2. 
  4. You install Service Pack 1 (SP1) for Windows 7 and Windows Server 2008 R2.

In this scenario, all inbox tasks in Windows Server 2008 R2 and all tasks that are created after the upgrade from Windows Vista and Windows Server 2008 are affected.

To avoid this problem, use one of the following methods:

  • Upgrade directly from Windows Vista or Windows Server 2008 to a version of Windows 7 or Windows Server 2008 R2 that includes SP1. 
  • After you upgrade to the RTM version of Windows 7 or Windows Server 2008 R2, install security update 2305420 before you install SP1.

To resolve this issue if it has already occurred, follow the steps in the “Workaround” section of “Known issue 2.”

Known issue 2

After you upgrade from Windows Vista or Windows Server 2008 to Windows 7 or Windows Server 2008 R2 by using an installation package that includes this security update (KB2305420), you may find that scheduled tasks do not work correctly. For example, you may receive an error message that resembles the following when you open Task Scheduler:

This task image is corrupt or has been tampered with.

When you close the message, the task no longer appears in Task Scheduler.

Workaround

Important When you use the following registry workaround, any tasks that may have been corrupted by malware will also be validated. We recommend that you validate the Action that is associated with each task, including inbox tasks, to verify that the task is valid and is not associated with malware.

Important This section, method, or task contains steps that tell you how to modify the registry. However, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For added protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click the following article number to view the article in the Microsoft Knowledge Base:

322756 How to back up and restore the registry in Windows

NoteYou must perform the following steps while logged on as a local user who has administrative permissions.

To recover the corrupted tasks, follow these steps:

Step 1: Locate the corrupted task references in the registry and in Task Scheduler

To do this, follow these steps:

  1. Open Task Scheduler.
  2. Expand Task Scheduler Library tree in the left pane, and located the folder that contains the corrupted task. Make a note of the location of the corrupted task. You will need this information later in this procedure.
  3. Locate the registry sub-key that corresponds to the corrupted task in one of the following registry sub-key. You can locate the subkey by searching for the name of the task:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree

Click the registry sub-key that corresponds to the corrupted task, and then make a note of the GUID value in the “Id” entry. For example, {2911FBBD-A0AA-4A79-A8EE-84EF7555A71B}. You will need this information in the next step of this procedure.

  1. Locate the registry sub-key that corresponds to the corrupted task in one of the following registry three sub-keys. To locate this sub-key, search for the GUID value that you noted in the previous step. For example, {2911FBBD-A0AA-4A79-A8EE-84EF7555A71B}. The task will exist in only one of the three locations:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Plain

Or:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Logon

Or:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Boot

Make a note of the registry location of the corrupted task. You will need this information later in this procedure.

Step 2: Create a temporary copy of the corrupted task file

To do this, follow these steps:

  1. Open the following folder in Windows Explorer:
  2. %SYSTEMDRIVE%\Windows\System32\Tasks\<Corrupted_Task_Name>
  3. Locate and then copy the task file that corresponds to the corrupted task to a temporary location.


Step 3: Clean up the corrupted task

To do this, follow these steps:

  1. Delete the task file that corresponds to the corrupted task from the Tasks folder (%SYSTEMDRIVE%\Windows\System32\Tasks).
  2. Delete the registry sub-key that corresponds to the corrupted task from the following registry sub-key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tree

  1. Delete the registry sub-key that corresponds to the corrupted task from the following registry sub-key. The task will be in GUID format. For example, {2911FBBD-A0AA-4A79-A8EE-84EF7555A71B}.Note Refer to the note that you made earlier in this procedure to locate the registry folder.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks

  1. Delete the registry sub-key that corresponds to the corrupted task from one of the following registry three sub-keys. The task will exist in only one of the three locations and will be in GUID format. For example, {2911FBBD-A0AA-4A79-A8EE-84EF7555A71B}.Note Refer to the note that you made earlier in this procedure to locate the registry folder.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Plain

Or:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Logon

Or:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Boot

Step 4: Re-create the task by using the temporary backed-up copy

To do this, follow these steps: To do this, follow these steps:

  1. Open Task Scheduler.
  2. Expand Task Scheduler Library tree in the left pane, and open the folder that previously contained the corrupted task.Note Refer to the note that you made earlier in this procedure to locate the folder.
  3. Right-click the folder that previously contained the corrupted task, and then click Import Task.
  4. In the Open dialog box, select All files (*.*). Browse to the temporary folder that contains the backed up task file, and then select the task file. Click Open. The new task is created and is visible in Task Scheduler.

Or, you can use the following command line command to restore the backed-up task:

Schtasks.exe /CREATE /TN <New_Task_Name> /XML <Xml_File_Name>

MS10-092: Vulnerability in Task Scheduler could allow for elevation of privilege.

How to back up and restore the registry in Windows

Back up the registry

Windows 8.1 and Windows 8

  1. Swipe in from the right edge of the screen, and then tap Search. Or, point to the upper-right corner of the screen, and then click Search.
  2. In the search box, type regedit.exe, and then press Enter. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
  3. In Registry Editor, locate and click the registry key or subkey that you want to back up.
  4. Click File > Export.
  5. In the Export Registry File dialog box, select the location where you want to save the backup copy to, and then type a name for the backup file in the File name field.
  6. Click Save.

Windows 7 and Windows Vista

  1. Click Start, type regedit.exe in the search box, and then press Enter. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
  2. In Registry Editor, locate and click the registry key or subkey that you want to back up.
  3. Click File > Export.
  4. In the Export Registry File dialog box, select the location where you want to save the backup copy to, and then type a name for the backup file in the File name field.
  5. Click Save.

Restore the registry

Windows 8.1 and Windows 8

  1. Swipe in from the right edge of the screen, and then tap Search. Or, point to the upper-right corner of the screen, and then click Search.
  2. In the search box, type regedit.exe, and then press Enter. If you are prompted for an administrator password or confirmation, type the password or provide confirmation.
  3. In Registry Editor, click File > Import.
  4. In the Import Registry File dialog box, select the location where you saved the backup copy to, click to select the backup file, and then click Open.

Windows 7 and Windows Vista

  1. Click Start, type regedit.exe in the search box, and then press Enter. If you’re prompted for an administrator password or confirmation, type the password or provide confirmation.
  2. In Registry Editor, click File Import.
  3. In the Import Registry File box, select the location where you saved the backup copy to, click to select the backup file, and then click Open.

How to back up and restore the registry in Windows.