Editor error code 0x80070497 means Windows cannot open or save a file because another program is using it, or the file path is too long. The fix is usually to close the locking program, shorten the file name or folder path, or run the editor as administrator. Below is a full breakdown of why this error appears and the exact steps to resolve it on Windows 10 and 11.
What Is Error 0x80070497?
Error 0x80070497 is a Windows system error code that translates to ERROR_LOCK_VIOLATION. It occurs when a program tries to read or write to a file that is already locked by another process. In editors (like Notepad, VS Code, or custom text editors), this typically happens when:
- Another program (e.g., a preview pane, antivirus, or cloud sync) has the file open.
- The file path exceeds Windows’ 260-character limit (MAX_PATH).
- The file is on a network share or removable drive with permission restrictions.
- The editor lacks permission to write to the file’s folder.
The error is not specific to one editor—it’s a Windows-level error that any application can hit.
Why Does This Error Happen?
Windows enforces file locking to prevent data corruption. When an editor tries to access a file that another process has locked, Windows returns error 0x80070497. Common triggers include:
- File preview handlers in Windows Explorer or other apps holding a read lock.
- Cloud sync services (OneDrive, Dropbox) syncing the file at the same moment.
- Antivirus scans temporarily locking the file.
- Long path names: even if the file itself has a short name, the full path (e.g., C:\Users\Name\Documents\Project\Subfolder\…\file.txt) can exceed 260 characters, causing the editor to fail.
- Permissions: the editor is not running with sufficient rights to write to a protected folder (like Program Files or a system directory).
How to Fix Error 0x80070497
Try these fixes in order, testing the editor after each one.
- Close the file in other programs. Open Task Manager (Ctrl+Shift+Esc), look for processes that might have the file open (e.g., a PDF viewer, another editor, or a preview pane), and end them. Also close any file preview windows in Explorer.
- Disable the preview pane in File Explorer. In Explorer, click View > Preview pane to toggle it off. The preview pane often holds a lock on files.
- Shorten the file name or folder path. Move the file to a shorter path like C:\Temp\file.txt. If that works, rename the file to something shorter and consider restructuring your folders.
- Run the editor as administrator. Right-click the editor shortcut and choose Run as administrator. This can bypass permission issues, but use it only if you trust the file and the editor.
- Pause cloud sync and antivirus temporarily. If the file is in a synced folder, pause OneDrive or Dropbox sync. Also temporarily disable real-time antivirus scanning (re-enable after testing).
- Enable long paths in Windows (if the path is the issue). Open Registry Editor (regedit) and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Set LongPathsEnabled to 1 and restart. This is a system-wide change; be careful.
Common Misconceptions
Many users think this error means the file is corrupted or the editor is broken. That’s rarely the case. The error is about file access, not file integrity. Also, it’s not the same as error 0x80070490 (ERROR_NOT_FOUND) or 0x80070020 (ERROR_SHARING_VIOLATION), though the fixes overlap. Another misconception: running the editor as administrator always fixes it—but if the file is locked by another process, admin rights won’t help.
Preventing the Error in the Future
- Keep folder structures shallow to avoid long paths.
- Close files in other programs before editing.
- Exclude your working folders from antivirus real-time scanning (if safe).
- Disable the preview pane if you frequently edit files that other apps open.
- Use a version control system (like Git) to avoid manual file locks.
When to Seek Further Help
If the error persists after all steps, the file might be locked by a system process (like Windows Search indexer). Try rebooting in Safe Mode and opening the file there. If it works in Safe Mode, a background program is the culprit. If the file is on a network drive, check with your IT department about permissions. For files on external drives, try copying the file to the local disk first.
Frequently Asked Questions
Is error 0x80070497 dangerous?
No. It’s a file access error, not a security threat. It simply means the file is locked or the path is too long.
Can I ignore this error and continue working?
You can, but you risk losing unsaved changes. The editor may not save your work, so it’s best to resolve the lock before continuing.
Does this error happen on Mac or Linux?
No. 0x80070497 is a Windows-specific error. Other operating systems have their own file-locking messages.
Will enabling long paths fix all instances of this error?
Only if the cause is a path longer than 260 characters. If the cause is a file lock, it won’t help.
Why does this error appear in some editors but not others?
Different editors handle file locks differently. Some retry automatically, while others surface the error immediately. Also, some editors may have a built-in workaround for long paths.
Should I disable Windows Defender to fix this?
Only temporarily for testing. Disabling real-time protection permanently is not recommended. If Defender is the cause, add an exclusion for your working folder instead.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- Change Google Text-to-Speech Voice on Android
- How to Adjust Volume Levels on a Windows PC
- Reset Chrome Sync to Fix Problems
- Fix Mouse Not Working in Windows 11
- Fix Windows Defender Failed to Initialize Error
- How to Hide or Unhide NFTs on OpenSea Profile