BUG: CopyFile Fails with Read-Only Files

Article translations Article translations
Article ID: 145935 - View products that this article applies to.
This article was previously published under Q145935
Expand all | Collapse all


The CopyFile function fails and GetLastError returns ERROR_ACCESS_DENIED when you try to copy a read-only file to a core SMB server (such as a LAN Manager for UNIX server) or to a Netware server when the client computer uses real-mode network drivers. The destination file is created as a read-only file and is zero in length.


This error message occurs because there is a mismatch between the way that the Windows 95 or Windows 98 redirector accesses files and the way that these servers expect this access.


Remove the read-only attribute before calling the CopyFile function to allow the file to be copied correctly. After the copy is complete, then the read-only attribute can be restored.


Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Article ID: 145935 - Last Review: November 21, 2006 - Revision: 3.2
  • Microsoft Win32 Application Programming Interface, when used with:
    • Microsoft Windows 95
    • Microsoft Windows 98 Standard Edition
kbapi kbbug kbkernbase KB145935
Retired KB Content Disclaimer
This article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.

Give Feedback


Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com