STG_E_FILEALREADYEXISTS (0x80030050) — File Already Exists Fix
This error happens when Windows or an app tries to create a file that's already there. Usually a sync conflict or leftover temp file. Here's how to clear it fast.
What Actually Triggers 0x80030050?
This isn't some obscure Windows nonsense. STG_E_FILEALREADYEXISTS pops up when an application tries to create a file or folder that's already present. I see it most often with:
- OneDrive or Google Drive sync — a file gets stuck in pending state, then the sync engine tries to re-create it.
- Backup software — Acronis, Veeam, even Windows Backup can throw this if the target folder already holds a file with the same name.
- File Explorer or script errors — a leftover temp file from a crashed install, or a permission issue where Windows thinks the file exists but you can't see it.
Had a client last month whose QuickBooks kept failing with this error. Turned out a rogue .tmp file from a failed update was blocking the database creation. Took longer to find than to fix.
Cause #1: Stuck or Orphaned Temp Files
This is the most common cause. An app crashes mid-write, leaves a temp file behind, and next time it tries to write the same temp file — boom, error 0x80030050. Or the app creates a temp file, never deletes it, and the next run sees it as permanent.
Quick Fix: Clear Temp Folders
- Press Win + R, type
%temp%, hit Enter. Delete everything you can (skip files in use — just uncheck them). - Same for
temp(without %). Press Win + R, typetemp, delete what you can. - Hit Win + R, type
prefetch, delete everything there too. Windows will rebuild it.
If the error happens in a specific app (like AutoCAD or QuickBooks), open that app's temp folder. Usually under %appdata%\AppName\temp or %localappdata%\Temp. Nuke the contents.
Why this works: You're removing the phantom files that the app sees as "already existing." If the temp file was the blocker, the app recreates it cleanly next time.
Cause #2: OneDrive / Cloud Sync Conflict
OneDrive's sync engine is notorious for this error. You'll see it when a file is marked as "pending" in OneDrive's cache but already exists on disk. Happens when you pause sync, rename a file, then resume sync. Or when two devices try to sync the same file at once.
Fix: Reset OneDrive or Unlink + Relink
- Right-click OneDrive icon in system tray, click Settings.
- Go to Account tab, click Unlink this PC. Confirm.
- Re-open OneDrive, sign in again. This wipes the local sync cache and lets OneDrive rebuild file references.
If that's overkill, try this: locate the folder where the error appears, check for files with .tmp or .conflict in the name. Delete them. OneDrive will re-fetch the real file from cloud.
Alternative: If you don't want to unlink, open Task Manager, kill OneDrive.exe, then restart it from Start menu. This clears the sync cache in memory but not on disk.
Cause #3: Permission Issues or Hidden System Files
Sometimes the file exists but is hidden or protected. Windows throws 0x80030050 because it can't overwrite a system file or a file owned by TrustedInstaller. I've seen this on Windows Server machines running backup scripts that target C:\Windows\System32 — bad idea, don't do that.
Fix: Take Ownership or Run as Admin
- Right-click the folder where the error occurs, select Properties.
- Go to Security tab, click Advanced.
- Next to Owner, click Change. Enter your username, check Replace owner on subcontainers and objects, click OK.
- Now in the same Advanced Security window, click Add, select your user, give Full control. OK out.
Then try your operation again. If it still fails, check for hidden files. In File Explorer, go to View > Options > View, check Show hidden files, folders, and drives, uncheck Hide protected operating system files. Look for any file with the same name as what you're trying to create — delete it if safe.
Less Common But Worth Checking
- Antivirus locking the file — temporarily disable your AV, try the operation again. If it works, add an exclusion for the folder.
- Registry leftover — rare, but some apps store file paths in registry. Search for the file name in
HKEY_CURRENT_USER\SoftwareandHKEY_LOCAL_MACHINE\SOFTWARE. If you find a stale entry, delete it. - Disk full or corrupted — run
chkdsk C: /f(replace C: with your drive). If the drive is full, error can occur as Windows can't create the temp files needed for file operations.
Quick-Reference Summary Table
| Cause | Symptom | Fix | Time to Fix |
|---|---|---|---|
| Orphaned temp files | Error in same app after crash | Clear %temp%, temp, prefetch | 2 minutes |
| OneDrive sync conflict | Error in OneDrive folder | Unlink and relink OneDrive | 5 minutes |
| Permission / hidden files | Error in system or locked folders | Take ownership, show hidden files | 10 minutes |
Start with the temp file cleanup — it fixes 8 out of 10 cases. If that doesn't do it, move to the OneDrive fix. Permissions are a distant third but worth checking if the error is in a shared or system folder. Don't waste time on fancy registry hacks unless you're sure that's the issue.
Was this solution helpful?