Using Powershell and Handle to see what Program is locking a File

Configurare noua (How To)

Situatie

Solutie

If you want to check if a file is in use in scripts or from the command line, you can use the handle program. After downloading handle, navigate to its directory in Powershell. Then, run the following command:

./handle.exe -a -u "PATH TO LOCKED FILE"

The -a option tells handle to dump all available information on what is using the file, and the -u option tells it to also show the owners name.

Windows Powershell showing the result of using handle.exe to see what program is using a file.

To make it convenient to use handle from scripts, you can copy it to your programs folder and add it to your system path. You can also kill the process from your script.

Tip solutie

Permanent

Voteaza

(6 din 11 persoane apreciaza acest articol)

Despre Autor

Leave A Comment?