Enumerates locks via NetFileEnum
Calls netapi32's NetFileEnum over direct FFI to list every file opened through this machine's SMB shares, with name, path, and owning user.
Small, sharp, no nonsense.
Enumerates files held open over SMB via NetFileEnum and force-closes the handle with NetFileClose to clear "file in use" locks — elevated, no WebView2.
./locksmith --runUtility · Rust, eguiready, 0 errors · offlineCalls netapi32's NetFileEnum over direct FFI to list every file opened through this machine's SMB shares, with name, path, and owning user.
Passes the selected file's ID to NetFileClose to forcibly drop the server-side handle, releasing the lock behind a stuck 'file in use' error.
Renders an immediate-mode egui GUI on native OpenGL, so a ~4 MB single exe starts in half a second with no WebView2 or browser runtime.
“The action can’t be completed because the file is open in another program” — and no hint of which program. LockSmith lists the files held open over SMB on your machine and lets you close the session behind them. It’s Rust and egui, so it starts in half a second with no WebView2 or browser runtime, which matters when you’re chasing a stuck lock.
LockSmith uses Windows network file APIs such as NetFileEnum and NetFileClose, which require elevation.
Releasing a file lock forcibly closes a handle owned by another process. This can cause:
Use LockSmith only when normal methods have failed, such as closing the owning application, waiting for a copy to finish, or restarting a stuck process.
Download the latest release from:
https://github.com/Swatto86/LockSmith/releases
Run the executable as Administrator.
locksmith.exe and choose Run as administrator.| Shortcut | Action |
|---|---|
| F5 | Refresh file list |
| Delete | Release selected locks |
| Ctrl+A | Select all visible files |
| Ctrl+Click | Toggle row selection |
| Shift+Click | Select a range |
| Double-click | Release a single lock with confirmation |
git clone https://github.com/Swatto86/LockSmith.git
cd locksmith\src
cargo build --release
Run tests and checks:
cargo test
cargo fmt --check
cargo clippy
Run as Administrator.
This can be normal if no files are currently open via network shares, the Server service is not running, or there are no active shares on the machine.
Another process may immediately reopen the file, or the lock may be a local handle not visible through the network file API. Use Task Manager, Resource Monitor, or Sysinternals tools for deeper local-handle cases.
https://github.com/Swatto86/LockSmithhttps://github.com/Swatto86/LockSmith/releases