That 0X00000585 Error Is a Pain — Here's the Fix
Seeing ERROR_INVALID_INDEX (0X00000585) mid-work is infuriating. You're in the middle of something — installing a program, opening a file, running a system tool — and Windows throws this cryptic number at you. The root cause is almost always a registry key that points to a location or value Windows can no longer find. Let's get it sorted.
The Quick Fix: System Restore or Registry Cleanup
You have two solid routes. One is faster, the other is more thorough. Try the fast one first.
Route A: System Restore (Fast, Safe)
- Press Win + R, type
rstrui.exe, then hit Enter. This opens the System Restore wizard. - Click "Next." You'll see a list of restore points. Pick one from before the error started appearing. If you don't see any, check the "Show more restore points" box at the bottom.
- Click "Scan for affected programs" to see what'll be removed or reverted. Pay attention here — you might lose software you installed after that date.
- Click "Next," then "Finish." Your PC will restart and restore. After the reboot, you should see a success message. If the error's gone, you're done.
Why this works: System Restore reverts the registry to an earlier state, wiping out any orphaned keys that cause the invalid index error. It's the easiest solution because you don't need to dig into the registry yourself.
Route B: Manual Registry Cleanup (More Control)
If System Restore isn't an option, or you want to keep your recent changes, do this.
- Press Win + R, type
regedit, then hit Enter. That opens Registry Editor. Click "Yes" on the UAC prompt. - Back up your registry first. In Registry Editor, go to File > Export. Choose a location (your Desktop is fine). Under "Export range," pick "All." Name it something like "backup-2024-07-01.reg" and save it. If something goes wrong, double-click that file to restore everything.
- Now, press Ctrl + F to open Find. Type the error code
0X00000585and hit "Find Next." The search will crawl through every key and value. - Each time it lands on a key that contains this error, look at the data pane on the right. If you see a value path that doesn't exist (like a DLL path or a registry subkey that's missing), right-click the key on the left and choose "Delete." Confirm with "Yes." Be ruthless here — only delete if the path is clearly broken.
- Press F3 to find the next occurrence. Repeat until you've cleared all matches. This can take a while. I've seen machines with dozens of orphaned references.
Why this works: The error code 0X00000585 maps to "ERROR_INVALID_INDEX." Windows throws it when a registry key's index table entry points to a slot that doesn't exist. Deleting the offending key removes the bad pointer. The system stops looking for it.
Why This Error Happens (The Real Story)
Here's what's actually going on under the hood: Windows uses a registry structure called a "cell map index" to track each key. Think of it like a library card catalog. Each card (index) tells Windows where the book (data) is on the shelf. When you uninstall a program or a driver update goes wrong, sometimes the card stays but the book gets removed. Windows walks over, grabs the card, tries to find the book, and — bam — invalid index. The error happens because the index number references a cell that was reused or deallocated.
I've seen this most often after:
- A failed Windows Update (like a cumulative update for Windows 10 22H2 that stopped mid-install)
- A third-party uninstaller that missed registry orphans
- Manually deleting keys in Regedit without removing parent references
Less Common Variations of the Same Issue
Sometimes the error shows up in different places. Here's what I've run into over the years.
0X00000585 in Event Viewer
Check Event Viewer: Win + R, type eventvwr.msc, hit Enter. Look under Windows Logs > Application. Filter by source "DistributedCOM" or "Application Error." If you see the error code there, it's almost always a COM component that has a bad registry reference. Fix: re-register the DLL. Open Command Prompt as admin and run regsvr32 /u problematic.dll then regsvr32 problematic.dll. Replace problematic.dll with the DLL name from the event log.
0X00000585 During Windows Update
If this error pops up while updating, the Windows Update database is likely corrupted. Run the Windows Update Troubleshooter: go to Settings > Update & Security > Troubleshoot > Additional troubleshooters > Windows Update. Run it, restart, then try updates again. If that fails, reset the update cache manually. Open Command Prompt as admin and run:
net stop wuauserv
net stop cryptSvc
net stop bits
net stop msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net start wuauserv
net start cryptSvc
net start bits
net start msiserver
After that, check for updates again. The old folders get rebuilt fresh.
0X00000585 with File Explorer
If clicking a file or folder triggers the error, the Master File Table (MFT) on your drive might have a corrupted index. Run chkdsk from an admin Command Prompt: chkdsk C: /f /r. It'll schedule a scan for the next reboot. Restart your PC and let it run. This can take an hour or more on large drives. The scan looks for bad sectors and fixes file system index mismatches.
How to Stop This From Happening Again
You don't have to wait for the error to come back. Here's what works.
- Use a reputable uninstaller. Revo Uninstaller or Geek Uninstaller — both free — scan for leftover registry entries after you remove a program. Don't rely on the built-in Windows uninstaller alone. It leaves crumbs.
- Run disk cleanups regularly. Open Disk Cleanup as admin, select your system drive, and clean up "Windows Update Cleanup" and "Delivery Optimization Files." These accumulate over time and can trigger registry index issues.
- Stop manual registry editing unless you're certain. I've fixed dozens of machines where someone deleted a key thinking it was useless. If you must edit the registry, always back it up first (like I showed you above).
- Keep Windows Update current. Microsoft releases patches that fix registry handling bugs. Running an outdated version of Windows 10 or 11 leaves you vulnerable to index corruption from known issues.
- Run
sfc /scannowquarterly. System File Checker scans protected system files, including registry-related ones. Open Command Prompt as admin, typesfc /scannow, let it finish. It'll tell you if it found anything.
That's the whole deal. The error is annoying but it's not a hardware failure. It's almost always a registry mismatch you can clean up in a few minutes. Stick with the System Restore route first, then manual cleanup, and you'll be back to work before you know it.