This article was previously published under Q216368
When running a setup that was created by the Visual Basic Setup Wizard or Package and Deployment Wizard (PDW), the following error message is generated:
<file path and name>
An access violation occurred while copying the file.
where <file path and name> is the name of the file, including the complete path, that Setup is attempting to copy.
Another open program is using the specified file. In some cases, the file may be in use by the operating system.
Follow these steps to resolve the problem:
Verify that the file specified in the error message is redistributable. If the file is not listed as being redistributable, rebuild the distribution removing that file from the setup files.
In Visual Basic 5.0, check the files License.txt and Redist.txt, both of which are located in the "Program files\DevStudio\VB" folder.
In Visual Basic 6.0, check the files Eula.txt in the "Program Files\Microsoft Visual Studio\Common\Setup\1033" folder and Redist.txt in the "Program Files\Microsoft Visual Studio" folder.
If the file is redistributable, make certain that the user closes all open programs before installing the application. Booting Win9x in Safe Mode prevents most applications from loading automatically at startup, as does holding down the SHIFT key for the duration of the boot. Neither method disables anti-virus software, screen savers, and so forth, so they must be shut down manually if they load the problem DLL.
To determine which program is using the file, use a utility such as DLLView for Windows 9x or Process Explorer (formerly HandleEx) for Windows NT/Windows 2000. Both utilities are available as free downloads from a third-party Web site at the following address:
If all open programs are closed, and the user still receives the error message, the file may be in use by the operating system. In this case, the following alternatives are available to work around the error message:
Users can click Ignore in response to the error message. When they click Ignore, they will receive the same message again with the following additional information:
If you ignore a copy error, the file will not be copied. The application may not function properly as a result. Do you want to ignore the error?
If they click Yes, Setup continues installing the remaining files, and the application will often run properly without replacing the file.
If a version of the file that is compatible with the application is already on the user's target system, you can remove the file from the file you distribute to avoid the message altogether. See the MORE INFORMATION section later in this article for details concerning the files that most commonly cause this error message.
You can customize the Setup Toolkit project (Setup1.vbp). Microsoft Technical Support does not provide support for modifying the Setup Toolkit project, but the source code is available for customization. For more information, search on the phrase "setup toolkit project" in "Books Online" for Visual Basic 5.0 or the "MSDN Library Visual Studio 6.0." For additional information about programmatically replacing files that are in use, please refer to the following article in the Microsoft Knowledge Base:
140570 HOWTO: Moving Files That Are Currently in Use
You may want to consider using a third-party Setup program.
This error occurs most frequently when developers distribute the following files:
This error has also been reported less frequently with the following files:
NOTE:The following tables contain information about the files listed above, including which operating systems install them and which operating systems require them.
File Operating File File FileName System Installed? In Use? Version--------------------------------------------------------------Mfc40.dll Windows 95 No No Windows 95b Yes No 4.1.6139 Windows 98 Yes No 4.1.6139 NT 4.0 Yes No 4.1.6139Mfc42.dll Windows 95 No No Windows 95b No No Windows 98 Yes No 4.21.7325 NT 4.0 Yes No 4.2.6068Msvcirt.dll Windows 95 No No Windows 95b No No Windows 98 Yes No 4.20.6164 NT 4.0 Yes No 4.20.6201Msvcrt.dll Windows 95 No No Windows 95b No No Windows 98 Yes Yes 5.00.7128 NT 4.0 Yes Yes 4.20.6201Msvcrt20.dll Windows 95 Yes No 2.11.000 Windows 95b Yes No 2.11.000 Windows 98 Yes No 2.11.000 NT 4.0 Yes No 2.11.000Msvcrt40.dll Windows 95 No No Windows 95b Yes No 4.10.6038 Windows 98 Yes No 4.10.6038 NT 4.0 Yes No 4.20