locked
Cannot replace file when it already exists RRS feed

  • Question

  • I have recently started getting a problem where i can't replace a file. For example if i copy example.exe to a folder where another example.exe already exists it keeps saying "file in use" and if i click try again it displays the same error again. It lets me rename/delete the file as if its not in use, then if i click try again it works fine.

    So i have to manually delete the file before i can replace it otherwise it just says its in use. The problem also makes it difficult to debug/release projects in Visual Studio as i have to delete the file it can't write first and try debugging/building it again.

    Any solutions?

    Windows 7 Ultimate x64
    Monday, February 8, 2010 3:18 PM

All replies

  • Hi,

    could you please start ProcessExplorer and search (CTRL+F) for the file? Which application has open handles on it?

    André
    "A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
    Monday, February 8, 2010 4:01 PM
  • Well its strange cos when i do the following steps..


    1. Copy a file to E:\Example.exe
    2. Open the file then close it
    3. Delete the file (goes to recycle bin fine)
    4. Restore the file
    5. Try copy Example.exe again.... file in use. But i just deleted it and restored it. I'll upload a video.


    EDIT: http://www.filefactory.com/file/b002049/n/Error.avi
    Monday, February 8, 2010 9:43 PM
  • Any news or suggestions?
    Saturday, February 13, 2010 4:53 PM
  • Have you tried my suggestion with ProcessExplorer? Do you see which program has open handles on the file?

    "A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
    Saturday, February 13, 2010 11:33 PM
  • ProcessExplorer didn't pick it up so its not in use but still don't let me overwrite it. Something strange happened yesterday....

    1. Create 1.bat (batch file) with some basic commands
    2. Ran the bat file (automatically closed)
    3. Edited bat file
    4. Went to save file but it wouldnt because it said its in use even though it closed. It normally lets me save even when its still running the batch file.


    Thanks
    Sunday, February 14, 2010 8:01 AM