The folder or file has been opened in another program
Sep 20, 2025 am 08:24 AMWhen the file is occupied, first check and close the relevant programs and try to restart the computer; if it is invalid, use the task manager, resource monitor or Process Explorer to locate the occupied process, and forcefully terminate it by ending the task or taskkill command; for prevention, you need to develop good operating habits, avoid previewing or directly operating on mobile/network drives, and keep software updated.
When you encounter a prompt that "the folder or file has been opened in another program", this usually means that a running application or system process is occupying the file or folder, preventing you from deleting, moving, renaming, etc. The core of solving the problem is to find and close that "occupant".
When dealing with this problem, I usually start from the simplest and most direct way and gradually go deeper. The most direct way is to think about whether you have just opened a program, such as a document editor, image viewer or player. Many times, we just forget to close it. If there is no obvious procedure, I will try the following steps:
- Close all related applications: For example, if you are trying to delete a Word document, then make sure that the Word program is completely closed.
- Wait for a moment: After some programs are closed, their background process may take a few seconds to completely release the file handle. Give it some time.
- Restart the computer: This is the most violent but also the most effective "panacea". Restarting will clear all processes in memory and usually solves most file occupancy issues. But it is not the most elegant solution.
How to quickly identify and close a file-occupying program?
My experience is that most of the time, file occupation is not a complicated virus or malware, but a "little negligence" in daily use. But if restart is not the first choice, or problems occur repeatedly, then we need some more refined tools.
The Task Manager (Task Manager) that comes with Windows is the first line of defense. You can pass
Ctrl Shift EscOpen it quickly.
- Processes tab: Here are all running applications and background processes. You can try to find programs related to your target file here, such as if it is a picture file, and see if there is any image viewer or editing software running. Select it and click "End Task". However, this method is a bit like finding a needle in a haystack, especially when the process name is not as intuitive.
- “Details” tab: This one is more professional. You can click on "Image Name" or "PID" to sort it and then search carefully. But again, it doesn't tell you directly which process occupies which file.
The Resource Monitor is the Resource Monitor . Enter in the search box of the Start Menu
resmon.exeAnd run.
- Under the CPU tab, find the Associated Handles section. Enter the full path or file name of the file you are occupied in the search box (e.g.
C:\Users\YourName\Documents\myfile.docx
). - All processes holding the file handle are listed. Once found, note its PID (process ID) or image name.
- Return to the Task Manager, switch to the "Details" tab, find the corresponding process, and right-click to select "End Task Tree" or "End Task". Please note that ending the task may cause unsaved data to be lost, so please think twice before operating.
Faced with stubborn file locking, what are the advanced methods besides restarting?
Sometimes, files are occupied very stubbornly, and ordinary methods don't work at all. At this time, my thinking will turn to more underlying system tools.
Process Explorer (from Microsoft Sysinternals suite) is my first choice. It is much more powerful than the task manager and provides more detailed process information.
- Download and run Process Explorer (it is a portable tool that is installed without installation).
- In the main interface of Process Explorer, click "Find" -> "Find Handle or DLL..." in the menu bar (or use it directly
Ctrl F
). - Enter the full path or file name of the occupied file in the search box.
- Process Explorer lists all processes that occupy the file handle. Select the corresponding row, and the window below will show which process is occupying it.
- Right-click the process and select "Kill Process" or "Kill Process Tree". Again, this forces the process to terminate, make sure you understand the consequences.
If you can't even process Explorer directly, or if you want to try a more "technical flow" solution, you can consider using command line tools .
- Open the command prompt (CMD) or PowerShell for administrator permissions.
- Assuming you have found the process ID (PID) that occupies the file through Resource Monitor or Process Explorer, you can use
taskkill
Command to terminate it:taskkill /F /PID [process ID]
For example:taskkill /F /PID 1234
- If you know the image name of the process (e.g.
notepad.exe
), it can also be like this:taskkill /F /IM [Image Name]
For example:taskkill /F /IM notepad.exe
/F
Parameters indicate forced termination. This trick is usually very effective, but it also comes with risks.
How to effectively prevent files from being accidentally locked by programs?
Instead of solving problems every time you encounter them, it is better to reduce the occurrence of such situations from the source. This is not only a technical issue, but also a habit of use.
- Develop the habit of closing programs in time: After using up a file or folder, make sure to close all relevant applications. This sounds simple, but many people often forget. For example, after editing the document, shut down the computer directly, instead of saving it first and then closing Word.
- Understand background processes: Some programs, even if you ostensibly shut down, their background services or processes may still be running, especially some cloud synchronization tools (OneDrive, Dropbox, Google Drive) or antivirus software. They may temporarily lock files for synchronization or scanning.
- Use the file preview feature with caution: Turning on the file preview pane in the file manager can sometimes cause the file to be locked because the preview program needs to read the file content.
- Avoid direct operation on mobile hard drives or network drives: especially when the network environment is unstable, opening or editing files directly in these locations will be more likely to cause the problem of untimely release of file handles. My suggestion is to copy it to the local area first, and then pass it back after editing.
- Regular updates to systems and applications: software bugs can sometimes cause file handles to not be released correctly. Keeping the system and commonly used software updated can reduce the occurrence of such problems.
After all, it is a common "little trouble" to be locked, but through some tools and good usage habits, we can completely "tamed" it. It reminds us that in the computer world, everything has its own rules, and understanding these rules can better control it.
The above is the detailed content of The folder or file has been opened in another program. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

ArtGPT
AI image generator for creative art from text prompts.

Stock Market GPT
AI powered investment research for smarter decisions

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Windows 11 can enable the taskbar clock to display seconds through settings, registry, command line, or third-party tools. 1. Turn it on in settings: Go to Personalization → Taskbar → Taskbar Behavior and turn on "Show seconds in system tray clock"; 2. Registry modification: Create a new DWORD value ShowSecondsInSystemClock under HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced and set it to 1; 3. Command line execution: Run PowerShell as an administrator and enter regaddHKCU\Softw

First, use the DISM command to install .NET Framework 3.5 from local sources. If it fails, enable the function through the control panel, then repair the system files and reset the update service, check the group policy settings, and finally use third-party tools to assist in the repair.

Screen tearing is caused by the graphics card frame rate being out of sync with the monitor refresh rate, which can be solved by enabling windowed optimization, turning off full-screen optimization, setting vertical sync, calibrating the refresh rate, and turning off automatic HDR.

First, adjust the hardware acceleration settings, close and then restart the Edge browser; second, update or reinstall the graphics card driver to improve compatibility; then clear the GPUCache folder in the ShaderCache; and finally, reset the browser settings to eliminate abnormalities.

Error code 0x00000709 usually causes shared printer connection failure due to insufficient permissions, system update conflicts, or service abnormalities. You can use professional tools to repair it with one click, or solve this problem by modifying registry permissions, uninstalling specific updates such as KB5005569, restarting PrintSpooler and related services, and adding Windows credentials (such as IP address and guest account).

1. Refreshing the DNS cache can solve the problem of web pages failing to load or domain name resolution errors. 2. Execute ipconfig/flushdns through the command prompt to clear the system DNS cache. 3. Run the command prompt as an administrator and restart the DNSClient service (netstopdnscache and netstartdnscache) to restore service functions. 4. Visit chrome://net-internals/#dns in the Chrome browser and click "Clearhostcache" to clear the browser's independent DNS cache. 5. Changing the DNS server to 8.8.8.8 and 8.8.4.4 can improve the resolution speed and accuracy.

IfanolderapphasissuesonWindows11,usecompatibilitymode:runthebuilt-introubleshooter,manuallyselectapastWindowsversion,enableadministratorrights,oradjusthigh-DPIsettingsforbetterdisplayandperformance.

1. Quickly switch to compatibility mode by clicking the lightning icon in the address bar; 2. Add specified website rules in the settings to achieve automatic compatibility; 3. Use the Alt T shortcut key to bring up the kernel switching menu; 4. Set global compatibility through desktop shortcut properties.
