I Need To Make A Change With My IT Support! Call (225) 706-8414

Find Out Which Windows Process Has Your File Open

Sometimes you’ll find a file you need to modify is locked by another process in Windows. You need to determine which process has the file open.

Solution

The traditional opens: A really cool tool for this is Unlocker. It’s a GUI-based tool. BUT, it’s really hard to find a non-malware version. Process Explorer from Sysinternals also will do this, but it’s harder to drill down to the specific file you want if you don’t know the process that has a lock on it. Sysinternals also has handle.exe, but you have to download that program.

Windows now includes a built-in feature for this fortunately. I suspect it came out of the Sysinternals acquisition by Microsoft several years ago. The tool is openfiles.

NOTE: You need to Run As Administrator your CMD or PowerShell.

To list local files opened by remote systems (i.e., via shared folders), run openfiles with no command-line options:

C:> openfiles

To list local files you need to enable it:

C:> openfiles /local

If you get the error “INFO: The system global flag ‘maintain objects list’ is currently disabled.” you need to enable the feature and reboot before using it:

C:> openfiles /local on
C:> shutdown /r

So now let’s list all open files:

C:> openfiles

Files Opened Locally:
———————

ID Process Name Open File (Pathexecutable)
===== ==================== ==================================================
8 dwm.exe C:WindowsSystem32
556 dwm.exe C:WindowsRegistrationR000000000006.clb
608 dwm.exe C:WindowsSystem32en-USd2d1.dll.mui
8 TevoSource.exe C:WindowsSystem32
16 TevoSource.exe C:..1e18e3b_9.0.30729.6161_none_0a1fd3a3a768b895
24 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
28 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
32 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
36 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
40 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
44 TevoSource.exe C:..1e18e3b_9.0.30729.8387_none_08e793bfa83a89b5
52 TevoSource.exe C:..1e18e3b_8.0.50727.8428_none_88dcdb0b2fb19957
268 TevoSource.exe C:Replay.log
384 TevoSource.exe C:WindowsSystem32en-USnewdev.dll.mui
692 TevoSource.exe C:WindowsRegistrationR000000000006.clb

To find a specific file use findstr with the case-insensitive option (/I):

PS C:> openfiles | findstr /I QB
12 QBDBMgrN.exe C:Windows
20 QBDBMgrN.exe C:WindowsSysWOW64
36 QBDBMgrN.exe C:..4ccf1df_6.0.9600.17031_none_a9efdb8b01377ea7
412 QBDBMgrN.exe C:..4ccf1df_6.0.9600.17031_none_a9efdb8b01377ea7
12 qbupdate.exe C:Windows
20 qbupdate.exe C:..Common FilesIntuitQuickBooksQBUpdate
44 qbupdate.exe C:..ccf1df_5.82.9600.16384_none_7c55c866aa0c3ff0
572 qbupdate.exe C:..4ccf1df_6.0.9600.17031_none_a9efdb8b01377ea7
648 qbupdate.exe C:WindowsRegistrationR000000000006.clb
696 qbupdate.exe C:WindowsSysWOW64en-USntdll.dll.mui
728 qbupdate.exe C:..MicrosoftWindowsINetCachecounters.dat
1164 qbupdate.exe C:..4ccf1df_6.0.9600.17031_none_a9efdb8b01377ea7
1284 qbupdate.exe C:..RoamingMicrosoftSystemCertificatesMy
12 QBW32.EXE C:Windows
64 QBW32.EXE C:..4ccf1df_1.1.9600.17227_none_dad9452e5bcb7986

Learn more at the Microsoft openfiles page.

Concerned About Cyber Attacks?

CLICK HERE >

Want to Migrate to the Cloud?

CLICK HERE >
Office 365

Ready to Experience Microsoft Office 365?

Want the latest IT news directly in your inbox? Subscribe now!