Skip to main content

Overview

File Locksmith helps you discover which processes are locking a file or folder, preventing deletion, moving, or modification. It integrates directly into File Explorer’s context menu, allowing you to quickly identify and terminate locking processes.
Terminating processes may result in data loss. Always save your work before ending processes.

Activation

1

Enable File Locksmith

Open PowerToys Settings and enable File Locksmith
2

Right-Click File/Folder

In File Explorer, right-click on a locked file or folder
3

Select 'What's using this file?'

Choose the File Locksmith option from the context menu
4

View Locking Processes

A window appears showing all processes using the file

Key Features

Process Detection

File Handle Detection

Identifies processes with open file handlesShows read/write access modes

Folder Monitoring

Detects processes accessing foldersIncludes files within directories

Multiple Files

Check multiple files simultaneouslySelect multiple files in Explorer

Process Details

Shows process name, PID, and userFull path to executable

Context Menu Integration

Seamless File Explorer integration:
Menu location:
  • Right-click file/folder
  • “Show more options” (Windows 11)
  • “What’s using this file?” option

Process Information Display

Detailed information about locking processes:
  • Process Name: Application name
  • Process ID (PID): Unique process identifier
  • User: Account running the process
  • File Path: Full path to executable
  • Access Type: Read, Write, or Read/Write
  • Handle Count: Number of open handles

Process Termination

Gracefully terminate a process:
  1. Select process in File Locksmith window
  2. Click “End Process” button
  3. Confirm termination
  4. Process receives termination signal
  5. File/folder is unlocked
Note: Similar to Task Manager’s “End Task”

Configuration

Settings

Minimal configuration required:
boolean
default:"false"
Enable or disable File LocksmithControls context menu integration
boolean
default:"false"
Show in extended context menu onlyRequires holding Shift while right-clicking

Extended Context Menu

Reduce context menu clutter:
  • Disabled: Always visible
  • Enabled: Only visible when holding Shift
Windows 11 note: File Locksmith appears under “Show more options” by default

Use Cases

File Deletion Issues

Common scenario:
Solution:
  1. Right-click file → “What’s using this file?”
  2. Identify locking process
  3. Save work in that application
  4. End process
  5. Delete file successfully
Application closed but file still locked:
  • Background process still running
  • Crash left handles open
  • Service holding file
Use File Locksmith to:
  1. Find zombie process
  2. Terminate lingering handles
  3. Clean up properly

Development Scenarios

1

DLL Rebuild Issues

Cannot rebuild project due to locked DLL:
Identify: Test application still running
2

Log File Access

Cannot delete or move log files:
  • Application still logging
  • Log viewer has file open
  • Background service writing logs
Find: Which process is logging
3

Database Files

Database file locked:
  • SQLite .db file in use
  • Multiple connections open
  • Crashed application
Solution: End all database connections

System Maintenance

Folder Deletion

Cannot delete folder with locked filesFind all processes using folder contents

USB Drive Ejection

“Device is in use” errorIdentify processes accessing USB drive

File Moving

Cannot move files between foldersDiscover hidden locks

Update Installations

Installer cannot replace filesEnd processes before updating

Media Production

Video file locked by:
  • Video player in background
  • Encoder still processing
  • Preview generator
Use File Locksmith to find and close

Network Shares

Files on network drives:

Technical Details

Architecture

Handle Detection

File Locksmith uses Windows APIs to enumerate handles:
Process:
  1. Enumerate all system handles
  2. Filter handles of type “File”
  3. Query handle name/path
  4. Match against target file
  5. Return owning process information

Components

CLI Usage

File Locksmith can be used from command line:
Source: src/modules/FileLocksmith/FileLocksmithCLI/main.cpp

Process Termination

Multiple termination methods:

Keyboard Shortcuts

In File Locksmith Window

Troubleshooting

Check:
  • File Locksmith is enabled in PowerToys Settings
  • On Windows 11, check under “Show more options”
  • If extended menu enabled, hold Shift while right-clicking
Fix:
  1. Restart File Explorer
  2. Disable and re-enable File Locksmith
  3. Restart PowerToys
  4. Check shell extension registration
Possible causes:
  • System/kernel process holding file
  • File locked by Windows itself
  • Network share lock (remote process)
  • Permissions prevent detection
Solutions:
  1. Run PowerToys as Administrator
  2. Check Windows Event Viewer for file access logs
  3. Use Process Explorer for deeper analysis
  4. Restart computer to clear all locks
Reasons:
  • Insufficient privileges (need admin)
  • System-critical process
  • Process already terminating
  • Protected process
Try:
  1. Run PowerToys as Administrator
  2. Use “End Process Tree” option
  3. Use Task Manager with admin rights
  4. Restart computer
Protected processes: Cannot be terminated (e.g., csrss.exe, System)
Check:
  • Process actually terminated (check Task Manager)
  • File handle cleanup may take a moment
  • Another process opened file
  • File system sync delay
Steps:
  1. Wait a few seconds
  2. Re-run File Locksmith
  3. Check for additional locking processes
  4. Refresh File Explorer (F5)

Limitations

Cannot terminate remote processes:For files on network shares, File Locksmith shows which remote computer/user has the file open but cannot terminate processes on remote machines.Workaround: Administrator must close file from server side or use server management tools.

Kernel-Mode Locks

Some file locks are held by kernel drivers:
  • Antivirus scanners
  • File system filters
  • Disk encryption software
  • Backup agents
These may not appear in File Locksmith’s process list.

Permission Requirements

To terminate processes:
  • User processes: No special permissions
  • Other users’ processes: Administrator rights
  • System processes: Administrator + may be protected
  • Services: Administrator + service control rights

See Also