Celeb Glow
general | February 28, 2026

How to know which processes are using the specified file

The system will give an error when I try to delete it. Of course I know the command Stop-Process can help me kill the process. But I don't know which processes are using it. Can anybody tell me how the find the processes which are using the specified file?

PS:this is my powershell version:

4

1 Answer

1.How to Find Out Which Windows Process is Using a File (Process Explorer)

2.PowerShell method:

IF((Test-Path -Path $FileOrFolderPath) -eq $false) { Write-Warning "File or directory does not exist."
}
Else { $LockingProcess = CMD /C "openfiles /query /fo table | find /I ""$FileOrFolderPath""" Write-Host $LockingProcess
}

3.WhoLockMe Explorer Extension v2.0 beta (NT-Win2K-XP) - Explorer extension which adds a right-click menu option

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy