the action can't be completed because the folder or a file in it is open in another program

standuhuajun 91 Reputation points
2020-12-25T07:14:13.59+00:00

This problem occurred on windows server 2016. We want to know how to delete this folder and what programs let us not delete this folder?51129-111.jpg

Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,549 questions
{count} votes

7 answers

Sort by: Most helpful
  1. Dale Kudusi 3,241 Reputation points
    2020-12-28T09:12:13.4+00:00

    Hi,
    To find and close the process that has the file open, please follow this steps:

    1. Open resource monitor (Windows +R to open Run then type Resmon.exe)
    2. Open the CPU tab in the monitor
    3. Select all processes (not sure if this is needed, you can probably just search for the handle)
    4. Expand "associated handles"
    5. Search for the file you need
    6. Close the process that has the handle

    **
    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    24 people found this answer helpful.

  2. Anonymous
    2020-12-25T14:10:19.787+00:00

    You can use Process Explorer to find the responsible process, then kill it.
    https://zcusa.951200.xyz/en-us/sysinternals/downloads/process-explorer

    --please don't forget to Accept as answer if the reply is helpful--

    1 person found this answer helpful.

  3. Mike Bramm 6 Reputation points
    2022-01-27T19:25:05.923+00:00

    This error message seems to be triggered by any application that has navigated to the folder in question, usually with the File - Open/Save/Save As dialog. Even after that dialog has closed, I think the API should release the handle that is connected to that folder. The API should just save the path in a variable and let go of the handle. I know that the handle is held open so that the next time you open that dialog, the same path will be navigated to, but if that path is no longer valid, just open to that folder's next available parent directory, or even just that drive's root directory. I'll bet hundreds if not thousands of people get this error message every day, and probably just end up either leaving the abandoned file/folder there, or rebooting to solve the problem.

    Either fix the API's that are keeping the handle open after the dialog is closed, or fix the error message dialog to show the user which applications are using that folder. BTW, this is not just related to Windows Server 2016. This has been a problem with at least Windows 7, 8, 8.1 and 10.

    1 person found this answer helpful.
    0 comments No comments

  4. Mark 5 Reputation points
    2023-04-17T12:45:54.36+00:00

    I encountered this problem. I found that deleting the folder from Quick Access resolved this problem for me.

    1 person found this answer helpful.

  5. Svein Arne Hylland 1 Reputation point
    2022-11-30T09:57:47.817+00:00

    I have also noticed that Microsoft Power Query use default OLEDBConnection.MaintainConnection = True. This will also result in this dialog when owner is trying to update or replace the source file. That is because any open workbook with a open connection to the source trigger the file as busy.

    Microsoft should have implemented the old 'Read only' as default to all kinds of Power Query Connections to avoid this annoying occupation of files.

    A work around in VBA is to turn off OLEDBConnection.MaintainConnection with this code, but that will requires the use of xlsm format in Excel.

    Dim conn As Variant
    For Each conn In ActiveWorkbook.Connections
    conn.OLEDBConnection.MaintainConnection = False
    Next conn

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.