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.
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
- 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.
- If it fails everywhere, repair the servicing components with
DISM /Online /Cleanup-Image /RestoreHealth, thensfc /scannow, then reboot and retry. - 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.
- 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.
- Run one scan from Settings to prove the agent itself is healthy.
- Inspect the criteria string the tool passes. Criteria are field and value expressions joined with
andoror, such asIsInstalled=0 and Type='Software' and IsHidden=0. - Replace curly quotes with straight ones, then reduce to a single clause and add terms back until it fails.
- 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.
- Stop
wuauserv,bitsandcryptsvcfrom an elevated prompt. - Rename
C:\Windows\SoftwareDistributionandC:\Windows\System32\catroot2. - Start the three services again and run a fresh scan.
- 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.
- Re-download the cabinet and compare its size against the source.
- Unblock it after copying between machines: Properties, tick Unblock, or run
Unblock-File. - Pass an absolute local path rather than a UNC path or a mapped drive.
- 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.
- Install the latest servicing stack update and cumulative update, then reboot. The agent updates itself alongside them.
- 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.
- 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.
- Run
DISM /Online /Cleanup-Image /RestoreHealthand let it finish. - 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. - Follow with
sfc /scannowand 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
- Prove the agent is healthy with one scan from Settings.
- Run the same operation from a minimal local script rather than through the tool, to separate the tool from the machine.
- Check the tool’s version against the build of Windows. Modules written against older agents call methods that have since been removed.
- 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.
- 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
- A scan from Settings, Windows Update lists updates or reports the device is up to date, with no error code.
DISM /Online /Cleanup-Image /ScanHealthreports no component store corruption.Get-WindowsUpdateLogshows the newest scan reaching the service and returning a result.- 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.
