File is locked or Access Denied Error Message

Are you trying to save an application data file and getting an error message that says:

"Cannot read file. File is locked"


"Access Denied"


"Lock Error?"

Did you try opening the file using a universal naming convention (UNC) path?

A UNC path looks like this: \computernamesharename.

Microsoft has a fix for this, or you can work around it by editing the registry.

This article contains information about modifying the registry. Before
you modify the registry, make sure to back it up and make sure that you
understand how to restore the registry if a problem occurs.

When you try to save a file such as a Microsoft Excel workbook that you
opened by using a universal naming convention (UNC) path, you may
receive an error message that is similar to one of the following:

"Cannot read file. File is locked"


"Access Denied"

"Lock Error"

Event Viewer may contain the following event:

Event Type: Information
Event Source: Application Popup
Event Category: None
Event ID: 26
User: N/A
Description: Application popup: Windows – Delayed Write Failed :
Windows was unable to save all the data for the file
name_of_the_file_you_want_to_save. The data has been lost. This error
may be caused by a failure of your computer hardware or network
connection. Please try to save this file elsewhere.


This problem occurs when the redirector flushes the contents of the
file, and writes to a file handle with read-only access instead of to a
file handle with write access. When the redirector received an
opportunistic lock break to none, it purged the cache for the file, but
did not

uninitialize the cache for the file. The redirector also needed
to purge and uninitialize when the set end of file occurs because the
opportunistic lock break is asynchronous. Because it did not
uninitialize the cache for the file, it wrote to the incorrect file


A supported fix is now available from Microsoft, but it is only
intended to correct the problem described in this article. Only apply
it to systems that are experiencing this specific problem. This fix may
receive additional testing to further ensure product quality.
Therefore, if you are not severely affected by this problem, Microsoft
recommends that you wait for the next Windows XP Service Pack 2 that
contains this fix.

To resolve this problem immediately, contact Microsoft Product Support
Services to obtain the fix. For a complete list of Microsoft Product
Support Services phone numbers and information about support costs,
visit the following Microsoft Web site:…EN-US;CNTACTMS

In special cases, charges that are ordinarily incurred for support
calls may be canceled if a Microsoft Support Professional determines
that a specific update will resolve your problem. The usual support
costs will apply to additional support questions and issues that do not
qualify for the specific update in question. The English version of
this fix has the file attributes (or later) that are listed in the
following table. The dates and times for these files are listed in
coordinated universal time (UTC). When you view the file information,
it is converted to local time. To find the difference between UTC and
local time, use the Time Zone tab in the Date and Time tool in Control


If you use Registry Editor incorrectly, you may cause serious problems
that may require you to reinstall your operating system. We cannot
guarantee that you can solve problems that result from using Registry
Editor incorrectly. Use Registry Editor at your own risk. To work
around this problem, disable opportunistic locking on the file server:

1. Click Start, and then click Run.
2. In the Open box, type regedit, and then press ENTER.
3. In Registry Editor, locate the following subkey in the registry:
HKEY_LOCAL_MACHINESYSTEMCurrentControlSet ServicesLanmanServerParameters
4. In the right pane, click EnableOplocks, and then press ENTER.
5. In the Value data box, type 0, and then press ENTER.
6. Quit Registry Editor.


Microsoft has confirmed that this is a problem in the Microsoft products that are listed below:

  • Microsoft Windows XP 64-Bit Edition
  • Microsoft Windows XP Home Edition SP1
  • Microsoft Windows XP Professional SP1


Please enter your comment!
Please enter your name here