Questions related about problems modifying files due a second programm with a read- or write-lock.
Questions tagged [file-in-use]
53 questions
15
votes
10 answers
InnoSetup - Erroneous "File in use by another process..." message while compiling
Although I really like InnoSetup, I have been suffering with this erroneous message for some time, but my frustration has reached new heights. There are numerous posts complaining about this problem, which is most certainly an InnoSetup bug, but no…

ron tornambe
- 10,452
- 7
- 33
- 60
11
votes
7 answers
"The process cannot access the file because it is being used by another process" with Images
I've seen many issues like this that have been solved and the problem was mostly due to streams not being disposed of properly.
My issue is slightly different, here follow a code snippet
foreach (Images item in ListOfImages)
{
newPath =…

Scriptworks
- 495
- 1
- 6
- 10
9
votes
4 answers
Rename a running executable (exe) file
We are trying to push updates to multiple servers at once and my manager has found that it is possible to rename running .exe file. Using that knowledge he wants to rename a running exe and copy over a new version of said exe such that anyone…

Astin
- 91
- 1
- 1
- 2
8
votes
1 answer
Delphi wait until a file copy process is complete
I have a thread that uses ReadDirectoryChangesW to notify me when a file is added or deleted in a folder.
For each new image, I open the file and create a thumbnail of the image. It would seem however that I receive the notification before the file…

Pieter van Wyk
- 2,316
- 9
- 48
- 65
4
votes
3 answers
Windows Installer-Avoid FileinUse dialog box when Installing a package
When ever there is an update patch of files that have to be replaced with the existing files and if one of the files is being used by any of the processes, then a file in use dialog box pops-up.I wanna avoid that dialog box and get that file queued…

teja
- 69
- 1
- 10
4
votes
2 answers
VB - Writing to a file with StreamWriter
I'm trying to write to a file using the StreamWriter.
Dim write as IO.StreamWriter
write = new io.streamwriter(file)
write.write(txtEncryption.text)
write.close
I stopped the code in debug mode and i saw it crashes and goes straight to the…

Bpk7
- 89
- 1
- 1
- 5
3
votes
2 answers
Detect file in use by other process
On windows and such I used to use a trick to find out of a file is currently in use (written specifically).
I use to open the file for writing and if it failed most likey another process is busy accessing it.
Sadly these trick (using C OPEN with…

Ger Teunis
- 945
- 1
- 14
- 30
3
votes
3 answers
How to fix 'file is in use by another process' error
I've created a program that is able to modify the contents of a .exe.config file (app config) through a datagridview with key value pairs displayed on the datagridview. The problem is, I have a save setting, which replaces the old value with a new…

tf.rz
- 1,347
- 6
- 18
- 47
2
votes
2 answers
import file when not in use (any more)
I have a flexdashboard which is used by multiple users. They read, modify and write the same (csv) file. I haven't been able to figure out how to do this with a SQL connection so in the meantime (I need a working app) I would like to use a simple…

Algomas
- 61
- 7
2
votes
2 answers
Get permission denied error when trying to remove file
First of all hi everyone,
my problem is, that my program creates a file, which is read by another program and after hat my program should delete the file.
I use the following code below to check if the file exists and if any other program uses the…

Dominik
- 25
- 5
2
votes
1 answer
File is Still in Use Error 32 How can I free it?
I am uploading a file via the following code.
After a successful upload I am attempting to Delete the file but I am getting a 32 - File in use error.
Can anyone tell me how I can resolve this file in use error? The following code is uploading the…

Trevor
- 16,080
- 9
- 52
- 83
1
vote
0 answers
IIS deployment error file is locked by an external process
I am facing file_is_use error while deploying .netcore api from azure pipeline to on-prem IIS server by using the tasks following task in CD pipeline
Steps I have tried but still error persists :
Stop the application , deploy and than…

Tahami Rizwan
- 41
- 4
1
vote
1 answer
Scheduled BAT - Error during XCOPY if file is in use
I have this script scheduled every hour:
@echo off
set path1="E:\Document\Backup"
set path2="E:\Document\NewDoc"
set path3="C:\ScanDoc"
forfiles -p %path1% -s -m *.pdf /D -30 /C "cmd /c del @path"
xcopy %path2%\*.pdf* %path1% /c
start /d %path3%…

Nifriz
- 1,033
- 1
- 10
- 21
1
vote
4 answers
Resolving exception file in use after closing StreamWriter
I am getting the error:
The process cannot access the file
'C:\AMR_VOYANT_TESTING\PWM_TESTER\UUT_LOGS\TEST_LOG_PWM_10245_UUT_SN_10.TXT'
because it is being used by another process.
My program flushes, closes, and disposes the log file. My…

Thomas Matthews
- 56,849
- 17
- 98
- 154
1
vote
1 answer
File remains in use until client refreshes page
I am attempting to delete image files from the server file system but I get a 'file in use by another process' error. I am trying to delete the image and it's associated thumbnail in one fowl swoop. I can get one to delete but the other will try and…

Jacob Landis
- 29
- 5