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

    Question

  • Hi

    I use the Window 7 32-bit Version and i am facing the problem to delete the folder. When i try to delete the folder then its show me message as "the action can't be completed because the folder or a file in it is open in another program"

    Please tell me way how can i delete the folder.

    Thanks

     

    Monday, August 02, 2010 10:18 AM

Answers

  • Handle is a tool that can help you to find out which program has a particular file or directory open. The tool is available here:

    http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

    I hope this helps.

    -a Dump information about all types of handles, not just those that refer to files. Other types include ports, Registry keys, synchronization primitives, threads, and processes.
    -c Closes the specified handle (interpreted as a hexadecimal number). You must specify the process by its PID.
    WARNING: Closing handles can cause application or system instability.
    -l Dump the sizes of pagefile-backed sections.
    -y Don't prompt for close handle confirmation.
    -s Print count of each type of handle open.
    -u Show the owning user name when searching for handles.
    -p Instead of examining all the handles in the system, this parameter narrows Handle's scan to those processes that begin with the name process. Thus:

    handle -p exp

    would dump the open files for all processes that start with "exp", which would include Explorer.
    name

    This parameter is present so that you can direct Handle to search for references to an object with a particular name.
    For example, if you wanted to know which process (if any) has "c:\windows\system32" open you could type:

    handle windows\system

    The name match is case-insensitive and the fragment specified can be anywhere in the paths you are interested in.

    Monday, August 02, 2010 8:37 PM
  • Close all open programs and try to delete the folder. If the problem persists, restart your computer in Safe Mode and try to delete the folder from there.

    To restart the computer in Safe Mode, press F8 before the Windows 7 loading animation begins and select "Safe Mode" from the menu.


    Microsoft MVP Windows Desktop Experience
    Monday, August 02, 2010 1:20 PM

All replies

  • Close all open programs and try to delete the folder. If the problem persists, restart your computer in Safe Mode and try to delete the folder from there.

    To restart the computer in Safe Mode, press F8 before the Windows 7 loading animation begins and select "Safe Mode" from the menu.


    Microsoft MVP Windows Desktop Experience
    Monday, August 02, 2010 1:20 PM
  • Handle is a tool that can help you to find out which program has a particular file or directory open. The tool is available here:

    http://technet.microsoft.com/en-us/sysinternals/bb896655.aspx

    I hope this helps.

    -a Dump information about all types of handles, not just those that refer to files. Other types include ports, Registry keys, synchronization primitives, threads, and processes.
    -c Closes the specified handle (interpreted as a hexadecimal number). You must specify the process by its PID.
    WARNING: Closing handles can cause application or system instability.
    -l Dump the sizes of pagefile-backed sections.
    -y Don't prompt for close handle confirmation.
    -s Print count of each type of handle open.
    -u Show the owning user name when searching for handles.
    -p Instead of examining all the handles in the system, this parameter narrows Handle's scan to those processes that begin with the name process. Thus:

    handle -p exp

    would dump the open files for all processes that start with "exp", which would include Explorer.
    name

    This parameter is present so that you can direct Handle to search for references to an object with a particular name.
    For example, if you wanted to know which process (if any) has "c:\windows\system32" open you could type:

    handle windows\system

    The name match is case-insensitive and the fragment specified can be anywhere in the paths you are interested in.

    Monday, August 02, 2010 8:37 PM
  • Open Windows explorer.
    Click ‘Organize -> Folder and search options’ (or ‘View -> Folder options’).
    Select the ‘View’-tab.
    In the ‘Advanced settings’ window, disable ‘Launch folder windows in a separate process’.

    You may need to force restart all explorer instances (via task manager) or reboot your computer if the setting is not applied immediately.

    Wednesday, July 27, 2011 7:37 PM
  • Hi. I had a problem trying to delete some file. I tried everything that is suggested here, and nothing worked.
    Then today i remembered something that's so simple..

    Restart the computer, keep holding down the F8 key when it starts to boot, and then on Windows Advanced Options Menu select -> Safe Mode with Command Prompt. Then you have to use Command Prompt (DOS) commands for managing your files. If you dont know them try this http://www.computerhope.com/msdos.htm . And theres plenty of others on the internet describing how to use Command Prompt. I used it for deleting the file, but you can use it for all the basic file management (renaming, moving, etc.). After that just restart your computer same way as you always do.

    Good luck!
    Friday, February 10, 2012 7:40 PM
  • To make this advice actually of some use, the way to accomplish what is asked; from a command prompt, usually open where the handle utility is located, type:

        handle <pathname of file>

    or

       handle <pathname of directory containing an open file>

    The results listed will tell for each open file the name of the process with it open, its pid, and and right before the file's pathname a hex handle number with a colon after it.

    To close a file

        handle -c <handle number> -p <pid> <pathname of file>

    When all open files have been closed the directory may be deleted or renamed or whatever.  Another expedient is to use "Task Manager" to simply kill the processes with it open (except for explorer.exe)  Do this judiciously.

    • Proposed as answer by coolPrash Thursday, June 27, 2013 8:14 PM
    Sunday, November 04, 2012 3:05 AM
  • The really really easy fix - I dragged and moved the two files with this problem to the desktop.   I was able to delete them there.
    • Proposed as answer by Cool Lady Wednesday, February 20, 2013 12:49 PM
    Wednesday, February 20, 2013 12:48 PM
  • Yep. You are the genius. Thank you.

    Wednesday, May 08, 2013 12:27 AM
  • Hi,

      That worked for me, I was able to delete the folder. 

    Thank You

    Nicholas.

    Sabrina Shen.

      Regards

        Sharath :)


    Wednesday, November 20, 2013 10:12 AM
  • The main reason for trudging through these various discussion sets is that once in a while someone comes up with a beautifully elegant solution.   Dragging to desktop to delete is one of those.  Thank you very much.
    Wednesday, February 12, 2014 6:33 PM