Click here to Skip to main content
15,881,281 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm writing an application that has to copy a file from the application directory in another one, specified by the user.

VB
My.Computer.FileSystem.CopyFile(Application.StartupPath + "\latest_version_info.dat", _
   My.Settings.DestPath + "\version_info.dat", True)


When I run it, I get an IOException that the file was used by another process. When I killed the "explorer.exe" to see if it caused the problem, everything went OK.

Can I somehow copy the file without getting this and wihtout needing to kill the "explorer.exe"?
Posted

1 solution

Why don't you try to use the 'Save As' option instead of copying..
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900