- How to find out which process is locking a file or folder in Windows 10
- Method-1 Use Resource Monitor to detect and end the process-
- Method-2 Use Process Explorer-
- How to Delete a Locked File in Windows 10
- How to Use Resource Monitor to Find Which Process Has Locked a File?
- View Associated Modules for a Process
- Related
- How do I find out which process is locking a file using .NET?
- Update
- Links to similar questions
- 6 Answers 6
- 4 Ways to Quickly Lock Files and Folders in Windows 10 Natively
- Ajinkya Bhamburkar
- 1. Locking a File in Windows
- 2. New User Account & File Permissions
- 3. Zip & Lock Files
- Changing File Extension
- 4. Make a New Partition & Hide it
- So, Whats Your Method?
- Read Next
- How to Manage Files and Folders Efficiently on Windows 10
- How to Delete Files on Windows 10 That Insist on Staying
- How to Turn off Auto-Lock in Windows 10
- How to Change BitLocker Password in Windows 10
- Top 13 Ways to Fix Folder Access Denied Error in Windows
- 2 Best Ways to Rename Multiple Files at Once on Mac
- Solid Explorer vs FX Explorer: Which Is the Best File Manager
- What’s the Difference Between PIN and Password for Login in Windows 10
- Did You Know
How to find out which process is locking a file or folder in Windows 10
August 11, 2020 By Sambit Koley
If you are trying to modify/ delete any particular file on your computer but an error message appears stating “The action can’t be completed because the folder is open in another program“, you can’t delete/ modify the file without stopping the other program which is using it. Some Windows 10 users are Follow the processes described in this article to find out which process is ‘locking’ the file on your computer, stop the process and you will be able to modify/ delete the file again on your computer.
Example–
At our end, we have tried to delete “adobe” from the Temp folder and it has returned an error message saying “The action can’t be completed because the file is open in Adobe Genuine Software Integrity Service“.
In both of the methods described below, we are going to use this case.
Method-1 Use Resource Monitor to detect and end the process-
In the Resource Monitor window, you can detect which application or service handle is holding the particular file, so you can easily end the process from there.
1. Press Windows key+R to launch Run window on your computer. In the Run window, type “resmon” and hit Enter.
Resource Monitor window will be opened on your computer.
2. In the Resource Monitor window, go to the “CPU” tab.
3. Now, expand “Associated Handles” and then in the search box type the name of the file you are facing trouble with (for us, it will be “adobegc“) and then click on the blue arrow in the same box to see the associated handles of that file.
4. You will see the associated handles for the file in the Associated Handles tab. Right-click on the process which is locking the file and then click on “End Process” to end the process on your computer.
After ending the particular service, try to modify/ delete the file again. This time, you will be able to do it. If you face any further problem go for the second method.
Method-2 Use Process Explorer-
Process Explorer is a tool from Microsoft which is very useful to detect any associated process holding any particular service on your computer.
1. Download Process Explorer on your computer.
2. After downloading the zip file, go to the downloaded location. Extract the downloaded “ProcessExplorer” zip file in a location of your choice.
3. Now, go to the extraction site on your computer. Double click on “procexp64” to run it on your computer (In case if you are using 32-bit Windows 10, you should run “procexp” on your computer).
4. In Process Explorer window, click on “Find” on the menu bar and then click on “Find Handle or DLL…” on your computer.
Wait for a while as Process Explorer will find the processes associated with the string you have entered.
5. In Process Explorer Search window, enter the search string beside ‘Handle or DLL substring:‘ and then click on “Search” just beside the search box.
6. Wait for a while as the Process Explorer will list the processes which are using the file. When the search is complete, click on the process in the process tab.
The following process will be highlighted in the Process Explorer window.
7. In Process Explorer window, right-click on the highlighted process and then click on “Close handle” to close the process on your computer.
Once you have closed the process, close the Process Explorer window on your computer.
That’s it! Now, you can easily modify/ delete the file on your computer. Your problem should be solved.
Sambit is a Mechanical Engineer By qualification who loves to write about Windows 10 and solutions to weirdest possible problems.
How to Delete a Locked File in Windows 10
By Bryan Clark 04 July 2017
When you run into a locked folder in Windows 10, the system won’t allow you to do anything with it — open it, delete it, or move it — without the password. For folders that you didn’t lock, finding the password often isn’t an option. You can’t open these folders, but you can delete them — even though a simple right-click “Delete” won’t work, nor will the delete button.
It should be noted, however, that deleting these files could wreak havoc on your system if you’re not sure why they’re there in the first place. Proceed with caution.
1. Locate the folder you wish to delete. I don’t have any locked folders I’m willing to delete, so let’s create an unlocked folder — and call it SkypeHost.exe (a copy of an actual locked file) — for the sake of the tutorial. It works the same, but you can just as easily remove this folder with the delete button.
2. Download Process Explorer from Microsoft’s website, and press OK on the pop-up window.
3. Double click processexp64 to extract the file.
4. Choose Extract All.
5. Click Open.
6. Double click the procexp64 application to open the application.
7. Select Run.
8. Read the terms and press the Agree button.
9. In the Process Explorer window, choose File > Show Details for All Processes.
10. Allow the app to make changes by pressing the Yes button.
11. Go the the Find menu at the top and select Find Handle or DLL.
12. Type in the file name and hit Search.
13. Right click the process in the bottom of the Process Explorer screen and select Close Handle. If there are multiple processes listed here, you’ll need to repeat this step to close all of them.
14. Delete the file as you would normally.
How to Use Resource Monitor to Find Which Process Has Locked a File?
I know many folks that use Windows SysInternals Process Explorer to gather information about running processes and their open handles. There is an excellent but less familiar utility in-built with Windows 7 and higher, called Resource Monitor which provides complete details of running processes, their associated handles and associated modules (for example, DLL files).
1. To launch Resource Monitor, press WinKey + R, type resmon.exe and press ENTER.
2. Select the CPU tab, and expand Associated Handles by clicking on its title bar
3. Type a file name or part of the file name in the text box provided. This should list the processes which are currently accessing the file(s)
Bonus Tip! You can also type a registry key in the search field, which would cause Resource Monitor to show the registry handles with the corresponding process names.
View Associated Modules for a Process
There is another option wherein you can view the list of modules that are in use by a given process. Simply select one or more processes in the Processes section, and then expand the Associated Modules section to view the list of modules used by the selected processes.
Resource Monitor proves to be an useful tool to investigate processes and locked files, and can come in handy especially when you forget to bring your troubleshooting toolkit along when fixing a friend’s PC. «Associated Handles» and «Associated Modules» is a nice feature addition in Windows 7 and higher. You can also use Process Explorer to find this info. Check out Know which process has locked a file.
Incidentally, you may’ve also noticed that the «File in Use» dialog in Windows 7 and higher, displays the Process Name as well.
Related
Want to find which program is eating away your internet bandwidth? Resource Monitor can tell that too.
How do I find out which process is locking a file using .NET?
I’ve seen several of answers about using Handle or Process Monitor, but I would like to be able to find out in my own code (C#) which process is locking a file.
I have a nasty feeling that I’m going to have to spelunk around in the win32 API, but if anyone has already done this and can put me on the right track, I’d really appreciate the help.
Update
Links to similar questions
6 Answers 6
One of the good things about handle.exe is that you can run it as a subprocess and parse the output.
We do this in our deployment script — works like a charm.
Long ago it was impossible to reliably get the list of processes locking a file because Windows simply did not track that information. To support the Restart Manager API, that information is now tracked.
I put together code that takes the path of a file and returns a List
of all processes that are locking that file.
Using from Limited Permission (e.g. IIS)
This call accesses the registry. If the process does not have permission to do so, you will get ERROR_WRITE_FAULT, meaning An operation was unable to read or write to the registry . You could selectively grant permission to your restricted account to the necessary part of the registry. It is more secure though to have your limited access process set a flag (e.g. in the database or the file system, or by using an interprocess communication mechanism such as queue or named pipe) and have a second process call the Restart Manager API.
Granting other-than-minimal permissions to the IIS user is a security risk.
4 Ways to Quickly Lock Files and Folders in Windows 10 Natively
Ajinkya Bhamburkar
22 Mar 2016
Recently my boss asked me to lend him my external hard disk (for reasons which can’t be explained). I was little uneasy as it contained some personal stuff which I was not comfortable sharing. Of course, I had the option of telling the true reason but didn’t want to seem rude. So I fired up Google to find some quick ways to lock up the files on Windows.
Turns out there is no way to do that without the help of an external app. Fortunately, I had an internet connection so I downloaded a simple app for the purpose and handed over the drive knowing my personal stuff was safe. But what if you’re stuck in a similar situation without access to the internet? There is popular script floating around the internet which makes it look like you’re actually locking a folder, but in reality, it just hides-unhides the folder and is not an effective method at all. So today we will see four ways in which you can cleverly hide your stuff natively in Windows without any external help (somewhat).
1. Locking a File in Windows
Before we move on to the various methods, it’s important to understand how encryption works in Windows. If you encrypt a file/folder in Windows, you can easily open it, transfer it or mail it and it will still open on the receiving end. So one might wonder what it is the use of Encryption then? The answer is that the encryption key (generated when you encrypt something for the first time) is associated with your account, more specifically to your password. So whenever you log into to your account all the encrypted files are decrypted on the fly and available in the normal state. But in case, if someone physically steals your drive or makes a new account on your PC, he/she will be unable to open them. Also, there are some limitations of encryption, it is only available to Pro edition users & will work only on NTFS partition. Now let’s see what are the basic steps to encrypt a file or folder in Windows.
Step 1: Any file or folder can be encrypted in Windows, provided the above conditions are satisfied. Right-click on the file > Properties > Advanced button under General tab > check the Encrypt contents to secure data.
Step 2: Click on OK and the filename will turn green or a lock symbol will appear depending on Windows version. You can add other users who can access the file by clicking the Details button as shown in the screengrab above and clicking on Add.
Cool Tip: Encryption is not only for Windows, it’s important on all platforms. Learn more about encryption for Mac, iOS and Android.
2. New User Account & File Permissions
If someone wants to use your PC or want to borrow your laptop you can just create a new account for them and change the permissions on the files and folders you don’t them to view. Let’s see the step by step process.
Step 1: Go to Control Panel > User Accounts, click on Manage another account > Add someone else to this PC. Make sure that the new account you’re creating is not an admin account or else this whole process will be futile as an admin account can override all permissions irrespective of file or folder.
Step 2: Once you have the new account set up, pool all your files and folder in one single folder. This will make managing permissions for several files easy. Right-click on the folder > Properties > Security tab, click on the edit button. A new window will open.
Step 3: In the new window click on the Add… button to add the new user to the list. One more window will open in which you have to enter the exact account name and then click on Check Names.
If the account doesn’t show up, click on Advanced… > Find Now, which list all accounts present on the PC. Select the account and click on OK, in both the previous windows to return to Permissions window.
Step 4: Once you have added the concerned account, check the Full Control box under Deny column and finally click Apply to save.
Now if someone tries to access those files they will get an Access denied error. For added effect give your folder some technical name like Windows System files or Admin Files to make it look like they are really system files. The above process can also be done in reverse i.e. setting the permissions for the files in the new account so the files cannot be accessed in the original account. This way someone will not get suspicious as why they are being given new account to use. But do mind the Admin account clause I mentioned earlier.
3. Zip & Lock Files
This method actually requires a third party app, 7-Zip to work. But 7-zip has become the de-facto apps for managing compressed files for Windows, it should always be present on everybody’s PC. If you are having WinRar, it will also work.
Step 1: Pool all your files in a single folder as you can’t add files once the archive is created. Right click on the folder and select 7-Zip > Add to archive….
Step 2: A new window will open with options to tweak. You may keep the default as they are. Under Encryption, enter the password of your choice, without which anyone will be able to open them. Finally, click on OK and you are done.
Note: Due to the way in which archives works, one can open the archive and see the filenames and file type. It’s only when they try to open or extract the file they will be asked for a password. So if you don’t want your, oh let’s just say collection of documentaries, to be browsed, first add them to a zip file and then add the zip to archive.
Changing File Extension
This method is one of those simple things which you would be astonished that you didn’t know before. Used in conjunction with zip files, it will effective for most of the users. And this also one of the only effective methods for Home edition users as their Windows doesn’t have encryption or Bitlocker.
Step 1: As usual put all your stuff in a single folder. Create a new zip file as shown in the screenshot below.
Step 2: Right-click on the zip file and change the extension .zip to something else. Again try avoiding popular extensions and name the file something technical . If you can’t see the .zip extension, you need to enable the setting by going to Control Panel > Folder Options > uncheck the Hide extensions for known file types option. It’s wise to turn this option ON again to confuse someone further.
4. Make a New Partition & Hide it
If you have enough free space on your hard disk you can make a free partition and dump all the stuff you want to lock in it and then hide it.
Step 1: Create a new partition by following the guide here or here.
Step 2: Copy all your stuff to the partition. From here on, Windows Pro edition users can just use Bitlocker or encrypt the contents (if the partition is on an external HDD) and Windows Home edition users can hide the partition by following the next step.
Step 3: Go to Control Panel > Administrative Tools > Create and format hard disk partitions > right click on the partition you created in Step 1 > Change Drive Letter and Paths …. In the new window, click on remove.
It will show a warning, accept it. Now your partition will not be visible in My Computer or anywhere in Windows. Of course, a clever user might figure this out and make the partition visible again following the method shown in the next step. To not let this happen, change the permissions for the partition as described above.
Step 4: To bring back the drive, again go to Control Panel > Administrative Tools > Create and format hard disk partitions > Change Drive Letter and Paths …. In the new window, click on Add, to assign a letter to the drive.
One other method is to create the new partition in Linux formats (ext2 or ext3). But that will require an external app but is also one of the simplest ways to hide something. To make an ext3 you can use any of the major partition managers available. This ext3 partition will not be visible in My Computer and to read or transfer the files stored on it, you will need an ext3 partition reader. I would recommend using this excellent open-source app. Of course, other alternatives are just a Google search away.
So, Whats Your Method?
The above methods are mostly for locking access or hiding files sans any external help. If you venture out there are numerous solutions available, some open source, some proprietary. If you have some other methods do share with us through comments.
Last updated on 5 Jul, 2019
The above article may contain affiliate links which help support Guiding Tech. However, it does not affect our editorial integrity. The content remains unbiased and authentic.
Read Next
How to Manage Files and Folders Efficiently on Windows 10
Here are some useful organizational tips and tricks on managing files and folders on # Windows 10 computers.
How to Delete Files on Windows 10 That Insist on Staying
There are some files in # Windows that just can’t be deleted. If you’re facing such issues on your # Windows 10 machine, try out these steps.
How to Turn off Auto-Lock in Windows 10
Learn how to turn off auto lock in # Windows 10, and why you should or shouldn’t turn it off or reasons behind it. There are two troubleshooting steps here.
How to Change BitLocker Password in Windows 10
Here are three ways to change # BitLocker # password on your # Windows 10 computer. I will also share a # BitLocker alternative that is equally good and free to use.
Top 13 Ways to Fix Folder Access Denied Error in Windows
Trying to open a folder on # Windows 10 but viewing the access denied pop-up error instead? Here’s a detailed # troubleshooting guide on how to fix this error and regain access.
2 Best Ways to Rename Multiple Files at Once on Mac
Wondering how to rename several files at once? Here are two useful ways to achieve rename multiple files in bulk on your # Mac.
Solid Explorer vs FX Explorer: Which Is the Best File Manager
In this guide, we will compare two amazing and feature-rich file managers — Solid Explorer and FX Explorer. Let’s see how they are similar and how they differ.
What’s the Difference Between PIN and Password for Login in Windows 10
Learn the difference between a # password and a PIN in # Windows 10 and why you should consider using one with your cloud Microsoft account for maximum # security.
Did You Know
Microsoft Edge was initially code-named Project Spartan.