LockSmith
Shows who has a file open over SMB and lets you force-close the session. Useful when someone's mounted your share and wandered off. Uses NetFileEnum — admin required.
“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.
What it does
- Lists files currently opened through Windows file sharing APIs.
- Filters by file name, path, or username.
- Sorts columns.
- Supports multi-select with Ctrl+Click and Shift+Click.
- Releases selected locks with confirmation.
- Supports light and dark themes.
- Runs fully offline with no telemetry.
Requirements
- Windows 10 or Windows 11.
- Administrator privileges.
- Rust only if building from source.
LockSmith uses Windows network file APIs such as NetFileEnum and NetFileClose, which require elevation.
Important safety warning
Releasing a file lock forcibly closes a handle owned by another process. This can cause:
- unsaved data loss
- application crashes
- file corruption if a write is interrupted
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.
Install
Download the latest release from:
https://github.com/Swatto86/LockSmith/releases
Run the executable as Administrator.
Basic workflow
- Right-click
locksmith.exeand choose Run as administrator. - Review the list of open files.
- Use search to filter by file name, path, or user.
- Select one or more rows.
- Click Release Selected Lock(s) or press Delete.
- Confirm the action.
Keyboard shortcuts
| 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 |
Known limitations
- Windows only.
- Administrator required.
- The underlying Windows APIs focus on files opened through SMB/network shares hosted by the machine. Local-only handles may not appear.
Build from source
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
Troubleshooting
Access denied
Run as Administrator.
No files are shown
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.
Releasing a lock did not fix the problem
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.
Links
- GitHub:
https://github.com/Swatto86/LockSmith - Releases:
https://github.com/Swatto86/LockSmith/releases