Skip to content

Est. 2011ยทMicrosoft Partner ID 7033487ยทDelivery under 3 minยทSupport 7 days a week

Your vault is empty.

Free Fix 0x80240031

0x80240031 and 0x80240036: Windows Update rejects the file or operation

10 min read Updated October 5, 2026 Windows Update & Setup

Fix it now

These are the update agent’s own argument checks, raised before anything leaves the machine. Microsoft publishes 0x80240031 as WU_E_INVALID_FILE, the file is in the wrong format, and 0x80240036 as WU_E_INVALID_OPERATION, the object’s current state did not allow the operation. Something is handing the agent a request it will not accept.

Run these in an elevated Command Prompt, in order

net stop wuauserv
net stop bits
net stop cryptsvc
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start cryptsvc
net start bits
net start wuauserv
  1. Scan from Settings, Windows Update rather than from your patch tool. If Settings works and the tool still fails, the tool’s request is the fault and no amount of resetting Windows will change that.
  2. If it fails everywhere, repair the servicing components with DISM /Online /Cleanup-Image /RestoreHealth, then sfc /scannow, then reboot and retry.
  3. If a script is involved, cut the search criteria back to one clause and add terms until it breaks. The last term you added is the invalid one.
  4. If an offline scan cabinet is involved, re-download it, unblock it after copying between machines, and pass an absolute local path rather than a UNC path.

Renaming the update data store discards update history and cached payloads. It uninstalls nothing that has already been applied.

If a scan from Settings now completes, the agent is healthy and anything still failing is the caller. Below is what each of the six codes is checking.

Why it happens

The Windows Update Agent is a COM service, and almost anything on the machine can drive it: the Settings interface, Configuration Manager, Intune, a remote monitoring agent or a hand-written script. Each caller creates a session, asks for a searcher, hands it a criteria string and works through the results. The codes on this page come from the agent’s own validation of that conversation, which is why they usually appear instantly and without any network activity.

Microsoft’s published wording separates them cleanly. 0x80240031 is WU_E_INVALID_FILE, the file is in the wrong format. 0x80240032 is WU_E_INVALID_CRITERIA, the search criteria string was invalid. 0x80240036 is WU_E_INVALID_OPERATION, the object’s current state did not allow the operation, which is what a script gets when it asks for a download before its search has finished. 0x80240037 is WU_E_NOT_SUPPORTED, the functionality for the operation is not supported at all.

The remaining two are about damaged data rather than a bad request. 0x8024000F is WU_E_CYCLE_DETECTED, circular update relationships were detected in the metadata: package A requires B which requires A. Genuine loops in the published catalogue are rare, so this is nearly always the local data store. 0x8024D001 is WU_E_SETUP_INVALID_INFDATA, the Windows Update Agent could not be updated because an INF file contains invalid information, which points at damaged agent binaries during a self-update.

A scripted scan is passing criteria the agent will not parse

You have this one if 0x80240032 or 0x80240031 appears only when your monitoring tool, scheduled task or PowerShell module triggers a scan, while Settings works normally.

  1. Run one scan from Settings to prove the agent itself is healthy.
  2. Inspect the criteria string the tool passes. Criteria are field and value expressions joined with and or or, such as IsInstalled=0 and Type='Software' and IsHidden=0.
  3. Replace curly quotes with straight ones, then reduce to a single clause and add terms back until it fails.
  4. Update any third-party update module in use. Older versions call methods newer agents no longer expose.

Microsoft documents the agent as usable from a remote computer by a caller with administrator rights, but only across part of its surface. CreateUpdateDownloader, CreateUpdateInstaller, the asynchronous BeginSearch and EndSearch methods and AcceptEula are among the calls not available remotely, so a remote script can search and then fail at the download or the install. Run it on the target through remoting, a startup script or your management agent.

The local update data store has lost its integrity

You have this one if 0x8024000F or 0x80240031 on a single machine, from every caller including Settings, surviving a reboot.

  1. Stop wuauserv, bits and cryptsvc from an elevated prompt.
  2. Rename C:\Windows\SoftwareDistribution and C:\Windows\System32\catroot2.
  3. Start the three services again and run a fresh scan.
  4. Delete the renamed folders once the scan succeeds.

The offline scan cabinet is the wrong file

You have this one if Only disconnected scans fail, with 0x80240031, while an ordinary online scan on the same machine completes.

  1. Re-download the cabinet and compare its size against the source.
  2. Unblock it after copying between machines: Properties, tick Unblock, or run Unblock-File.
  3. Pass an absolute local path rather than a UNC path or a mapped drive.
  4. Use a current copy. The agent refuses cabinets too old to describe the updates in question.

The operation is not available on this agent or in this state

You have this one if 0x80240036 or 0x80240037 on one specific action while ordinary scans succeed, often after a script was written against a newer build than the machine runs.

  1. Install the latest servicing stack update and cumulative update, then reboot. The agent updates itself alongside them.
  2. Check the edition. Microsoft documents its Update policies as applying to Pro, Enterprise, Education and IoT Enterprise, and some management calls behave differently on Server Core.
  3. In the calling code, confirm the search completes before the download is requested, and that a fresh session object is used rather than a stale one.

The agent’s own files are damaged

You have this one if 0x8024D001, usually during an agent self-update, with other servicing operations on the same machine also misbehaving.

  1. Run DISM /Online /Cleanup-Image /RestoreHealth and let it finish.
  2. If DISM cannot find a source, mount installation media of the same edition and build and add /Source:esd:D:\sources\install.esd:1 /LimitAccess.
  3. Follow with sfc /scannow and reboot. If the store still cannot be repaired, an in-place repair upgrade from matching media is what remains.

Full reference

The six codes as published

Code Published name Published description
0x80240031 WU_E_INVALID_FILE The file is in the wrong format
0x80240036 WU_E_INVALID_OPERATION The object’s current state did not allow the operation
0x80240037 WU_E_NOT_SUPPORTED The functionality for the operation is not supported
0x8024000F WU_E_CYCLE_DETECTED Circular update relationships were detected in the metadata
0x80240032 WU_E_INVALID_CRITERIA The search criteria string was invalid
0x8024D001 WU_E_SETUP_INVALID_INFDATA The Windows Update Agent could not be updated because an INF file contains invalid information

Commands worth knowing

Command What it does
Get-WindowsUpdateLog Converts update tracing into a readable log file
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow() Starts the documented Automatic Updates detection task
(New-Object -ComObject Microsoft.Update.ServiceManager).Services Lists the update services registered on the machine
DISM /Online /Cleanup-Image /ScanHealth Reports component store damage without attempting a repair
DISM /Online /Cleanup-Image /RestoreHealth Repairs the component store from Windows Update or a source you supply
sfc /scannow Checks and repairs protected system files using the component store

Reading a criteria string

Search criteria are the most common source of 0x80240032 and they are unforgiving in a specific way: the agent parses the whole string and rejects all of it if any part is wrong, so a single stray character produces the same code as a completely nonsensical query. Field and value expressions are joined with and or or, values are quoted with straight single quotes, and boolean fields take 0 or 1 rather than true or false. Documents and wikis are the usual source of the damage, because they helpfully convert straight quotes into typographic ones.

When the caller is the problem

  1. Prove the agent is healthy with one scan from Settings.
  2. Run the same operation from a minimal local script rather than through the tool, to separate the tool from the machine.
  3. Check the tool’s version against the build of Windows. Modules written against older agents call methods that have since been removed.
  4. Confirm where the script actually runs. Microsoft publishes a list of agent calls that are unavailable to a remote caller, including the downloader and installer objects, the asynchronous search methods and AcceptEula, so a script that works locally can fail partway through when pointed at another machine.
  5. Check for a second caller running at the same time, which produces state errors that look like format errors.

If the store cannot be repaired

An in-place repair upgrade rewrites the operating system around your data. It normally keeps files, applications and activation, but it cannot be reversed once it has started. Take a backup first and allow an hour.

What this is not

None of these codes indicates a licensing problem. Activation and update delivery are separate paths, and an unactivated machine fails with codes in the 0xC004 range rather than these. Equally, none of them is a network problem: the agent is refusing the job before a packet is sent, so proxies, firewalls and endpoint allowlists are not where the answer lives. Every tool used on this page ships with Windows, and the offline scan cabinet is a free Microsoft download.

Every code this article covers

Code What it points at Source
0x80240031 WU_E_INVALID_FILE. The file is in the wrong format Microsoft Learn
0x80240036 WU_E_INVALID_OPERATION. The object’s current state did not allow the operation Microsoft Learn
0x80240037 WU_E_NOT_SUPPORTED. The functionality for the operation is not supported Microsoft Learn
0x8024000F WU_E_CYCLE_DETECTED. Circular update relationships were detected in the metadata Microsoft Learn
0x80240032 WU_E_INVALID_CRITERIA. The search criteria string was invalid Microsoft Learn
0x8024D001 WU_E_SETUP_INVALID_INFDATA. The Windows Update Agent could not be updated because an INF file contains invalid information Microsoft Learn

Confirm the fix worked

  1. A scan from Settings, Windows Update lists updates or reports the device is up to date, with no error code.
  2. DISM /Online /Cleanup-Image /ScanHealth reports no component store corruption.
  3. Get-WindowsUpdateLog shows the newest scan reaching the service and returning a result.
  4. The tool that originally failed returns the same results as Settings.

Questions people ask about this

Does this mean my Windows licence is invalid?

No. Activation and update delivery are separate paths. These are argument and state errors inside the update agent, and an unactivated machine fails with different codes in the 0xC004 range.

Will renaming SoftwareDistribution remove updates I already have?

No. That folder holds the download cache, the scan data store and the history list. Applied updates live in the component store and are untouched.

Do I need to buy anything to fix this?

No. Every step uses tools built into Windows. Money only enters the picture if the machine runs a release that no longer receives updates at all, and that is an upgrade rather than a repair.

Can I run the update agent against a remote computer?

Partly. Microsoft documents remote use by a caller with administrator rights, but also publishes the calls that are not available remotely, among them CreateUpdateDownloader, CreateUpdateInstaller, the asynchronous BeginSearch and EndSearch methods, and AcceptEula. So you can search remotely but not download, install or accept licence terms, which is why it is simpler to run the script on the target through remoting, a startup script or your management agent.

Why does 0x80240036 appear halfway through my script?

Because the object was not in a state that allowed the call. The usual example is asking for a download before the search has completed, or reusing a session object from an earlier operation instead of creating a fresh one.

Related error codes

Was this article helpful?

Your feedback helps us improve our documentation.

Related articles

Free Fix 0x800703F1 and 0x80070091: a corrupt registry hive or a folder that will not empty License Error 0xC1420127 and 0xC1900403: the upgrade rolls back every single attempt Free Fix 0x80070422: the Windows Update service is disabled or refuses to start License Error 0x80070070 – 0x50011: the upgrade runs out of disk space and rolls back
โ† Back to Knowledge Base