Windows has a built-in openfiles utility

Use Windows openfiles for local file-handle troubleshooting, with the required tracking and restart.

I’ve always used Sysinternals Handle or Process Explorer to see what process has a file lock, but what do you do on a server that has no network connection?

Apparently Windows has a built-in utility 🤯

1openfiles /query

There’s an important bit I left out of the original post: local file-handle tracking must be enabled first. I was troubleshooting an issue with Hyper-V Server, which is a bit of a pain.

From an elevated command prompt, check the current tracking state:

1openfiles /local

If it’s off, enabling it requires a planned restart before it takes effect:

1openfiles /local on

After restarting, use openfiles /query /v for detailed output.

This isn’t an instant replacement for Handle on a server you can’t restart. Tracking is off by default and can slow down the system. When you’re done, openfiles /local off disables it after another restart.

The utility also has disconnect options for remotely opened shared files. Be careful: closing somebody’s open file can interrupt their work.

openfiles documentation

Original posts: 16 November 2020, local-tracking correction, and file-server follow-up. Documentation checked 14 October 2026.

Wednesday, October 14, 2026 Monday, November 16, 2020