Find open files on Windows

Often are Windows users face the problem that certain files easily locked and are these not then edit , delete or move can. A classic error message then looks like this.

The action cannot be completed because the file is open.

The exact message is then:

The action cannot be completed because the file is open.

Unfortunately, it is often not possible to see why a file is open and therefore accessible. This can be found out relatively easily, however, because Microsoft supplies the right tool with the name ” OpenFiles ” for all Windows versions . Unfortunately, this tool is relatively unknown and very few users are familiar with the functionality of OpenFiles .

Find open files on Windows

Before we can use the tool, it has to be activated. This works very simply by opening a command prompt with administrator rights and issuing the following command.

openfiles / local on

This looks like this:

openfiles local on

Windows then confirms the activation of OpenFiles as follows:

SUCCESS: The global system identifier “maintain objects list” is activated.
This change takes effect after a restart.

Generate list of open Windows files

The next step is to restart Windows. This restart then activates the logging of all open files under Windows. You now have the option of having a text file generated at a time of your choice so that you can then view all open files. To create this file, the following command must be issued.

openfiles>% userprofile% desktop files.txt

openfiles files.txt

You can of course specify any path where the list of open Windows files should be saved. In our case, we saved the FILES.TXT ” file directly on the desktop of the registered user. Below we have shown you an extract from the list of open files and you can see that a process keeps the Windows FAQ.docx file open.

Open files on Windows

Unfortunately, the list of open Windows files is sometimes very long because ” OpenFiles ” also lists all Windows system files. For this reason, you can use the following command to display only the extract from the report that contains a specific search term.

OpenFiles | FindStr / i SEARCH TERM

This looks like this:

openfile findstr

With the command ” OpenFiles / Local OFF ” you can of course deactivate the logging of the open files under Windows at any time.

Further descriptions of other useful Windows commands can also be found here:

– End the hung task or program with a command – Export
Windows print server (print server) configuration to file with command PRINTMBR
– Increase Windows 10 Uninstall period of 10 days
– Ping, IPConfig and Tracert as PowerShell commands
– Read WindowsUpdate.log with Windows 10 or via Reformatting PowerShell
– installing Windows roles and features with PowerShell
– reading computer system information with PowerShell
– preparing the Windows client for remote PowerShell commands with WINRM – editing
local users and groups with
PowerShell
– determining Windows system runtime with PowerShell – Windows 10 system restore point create
with PowerShell
– shutdown and restart Windows with PowerShell commands – repair Windows component store with DISM and PowerShell commands
– switch off UAC (user account control ) via PowerShell or registry in Windows 10
– PowerShell command to deactivate Fi rewall

administrator