Why Cant I Delete, Edit, or Rename a File That Is in Use?
To use File Locksmith,download and install Microsoft PowerToys.
Once installed, open PowerToys from the Start menu and tap the “Enable File Locksmith” toggle button.
The File LockSmith PowerToy will open and show a list of programs that are using the file.
you might also end the program that is using the file from this screen.
confirm it’s safe to end a program before doing so using any method on this page.
It’s worth having a goodbackup routineto protect against file loss.
Finally, bang out the name of the locked file in the search box, highlighted in red below.
You will then see a list of the processes using the file.
Afterdownloading handle, navigate to its directory inPowershell.
you’re free to alsokill the process from your script.