How to see all open files in windows

How to View and Close Open Files in Windows Server SMB Share?

Windows file server administrators often have to force close the shared files that are open simultaneously by multiple users. This usually happens if the desktop software doesn’t work as expected, the user logs off incorrectly, or when the user opened a file and forgot to close it (went home, on vacation, etc.). In all these cases, the file on the shared network folder is still open (and locked) and cannot be modified by other users. Other users can see such a message when trying to open a locked file (depending on the application used): The document filename is locked for editing by another user. To open a read-only copy of his document, click…

In this article we’ll show you how to get the list of open files on a Windows file server, find out which user locked a file on a shared folder, and how to close (reset) file sessions to unlock open files.

View Open Files on a Shared Network Folder on Windows Server

You can get the list of files opened by users on Windows file server using the built-in Computer Management ( compmgmt.msc ) graphic snap-in.

Open the Computer Management console on your file server (or connect to the server remotely from the management console running on your computer) and go to System Tools -> Shared Folders -> Open files. A list of open files on current SMB server is displayed on the right side of the window. The list contains the local path to the file, the name of the user account that opens the file, the number of locks and the mode in which the file is opened (Read or Write+Read).

You can get the same list of open files using the built-in openfiles.exe console tool. For example, using the following command you can get the Session ID, username and full local path to the open file:

openfiles /Query /fo csv |more

You can display a list of open files on a remote server. For example, you need to list all open files in shared folders on the lon-fs01 host:

openfiles /Query /s lon-fs01 /fo csv

How to Find Out Who is Locking a File in a Shared Folder?

To identify the user who opened (locked) the filename.docx file on the shared network folder on the remote server lon-fs01, run this command:

openfiles /Query /s lon-fs01 /fo csv | find /i «filename.docx»

You can specify only a part of the file name. For example, you need to find out who opened an XLSX file containing “sale_report” in its name. Use the following pipe:

openfiles /Query /s lon-fs01 /fo csv | find /i «sale_report»| find /i «xlsx»

Of course you can find this file in the Computer Management GUI, but it’s less convenient (this console doesn’t provide search feature).

How to Forcibly Close an Open File on a SMB Share?

To close an open file, find it in the list of files in Open File section and select Close Open File in the context menu.

If there are hundreds of open files on your file server, it won’t be easy to find the specific file in the console. It is more convenient to use the Openfiles command line tool. As we have already told, it returns the session ID of the open file. Using this session ID you can force close the file by resetting the SMB connection.

First, you need to find the session ID of the open file:

openfiles /Query /s lon-fs01 /fo csv | find /i «farm»| find /i «.xlsx»

Disconnect the user from file using the received SMB session ID:

openfiles /Disconnect /s lon-fs01 /ID 617909089

You can forcefully reset all sessions and unlock all files opened by a specific user:

openfiles /disconnect /s lon-fs01/u corp\mjenny /id *

Get-SMBOpenFile: Find and Close Open File Handlers Using PowerShell

New cmdlets to manage shares and files on an SMB server appeared in PowerShell version for Windows Server 2012/Windows 8. These cmdlets can be used to remotely close network connections to an open file.

Читайте также:  Установка achi режим без переустановки windows 10

You can get a list of open files using the Get-SMBOpenFile cmdlet. Close-SmbOpenFile is used to close/reset the connection to a remote file.

To display a list of open files on the Windows SMB server, run the command:

The command returns the file ID, session ID and full file name(path).
You can display a list of open files with user and computer names (IP addresses):

You can list all files opened by a specific user:

Get-SMBOpenFile –ClientUserName «corp\mjenny»|select ClientComputerName,Path

or from a specific computer/server:

Get-SMBOpenFile –ClientComputerName 192.168.1.190| select ClientUserName,Path

You can display a list of open files by pattern. For example, to list all exe files opened from the shared folder:

or open files with a specific name:

The Close-SmbOpenFile cmdlet is used to close the open file handler. You can close the file by ID:

Close-SmbOpenFile -FileId 4123426323239

But it is usually more convenient to close the file by name:

Get-SmbOpenFile | where <$_.Path –like "*annual2020.xlsx">| Close-SmbOpenFile -Force

With the Out-GridView cmdlet, you can make a simple GUI form for finding and closing open files. The following script will list open files. You should use the built-in filters in the Out-GridView table to find open files for which you want to reset the SMB sessions. Then you need to select the required files and click OK. As a result, the selected files will be forcibly closed.

Get-SmbOpenFile|select ClientUserName,ClientComputerName,Path,SessionID| Out-GridView -PassThru –title “Select Open Files”|Close-SmbOpenFile -Confirm:$false -Verbose

How to Close Open Files on Remote Computer Using PowerShell?

The Get-SMBOpenFile and Close-SmbOpenFile cmdlets can be used to remotely find and close open (locked) files. First, you need to connect to a remote Windows SMB server via a CIM session:

$sessn = New-CIMSession –Computername lon-fs01

The following command will find the SMB session for the open file pubs.docx and close the file session.

Get-SMBOpenFile -CIMSession $sessn | where <$_.Path –like "*pubs.docx">| Close-SMBOpenFile -CIMSession $sessn

Confirm closing of the file by pressing Y . As a result, you have unlocked the file. Now other users can open it.

With PowerShell, you can close SMB sessions and unlock all files that a specific user has opened (a user went home and didn’t release the open files). For example, to reset all file sessions of the user mjenny, run this command:

Get-SMBOpenFile -CIMSession $sessn | where <$_.ClientUserName –like "*mjenny*">|Close-SMBOpenFile -CIMSession $sessn

openfiles

Enables an administrator to query, display, or disconnect files and directories that have been opened on a system. This command also enables or disables the system Maintain Objects List global flag.

openfiles /disconnect

Enables an administrator to disconnect files and folders that have been opened remotely through a shared folder.

Syntax

Parameters

Parameter Description
/s Specifies the remote system to connect to (by name or IP address). Don’t use backslashes. If you don’t use the /s option, the command is run on the local computer by default. This parameter applies to all files and folders that are specified in the command.
/u [ \] Runs the command using the permissions of the specified user account. If you don’t use the /u option, system permissions are used by default.
/p [

] Specifies the password of the user account that is specified in the /u option. If you don’t use the /p option, a password prompt appears when the command is run. /id Disconnects open files by the specified file ID. You can use the wildcard character (*) with this parameter.

Note: You can use the openfiles /query command to find the file ID. /a

Disconnects all open files associated with the user name specified in the accessedby parameter. You can use the wildcard character (*) with this parameter. /o Disconnects all open files with the specified open mode value. Valid values are Read, Write, or Read/Write. You can use the wildcard character (*) with this parameter. /op Disconnects all open file connections that are created by a specific open file name. You can use the wildcard character (*) with this parameter. /? Displays help at the command prompt.

Examples

To disconnect all open files with the file ID 26843578, type:

To disconnect all open files and directories accessed by the user hiropln, type:

To disconnect all open files and directories with read/write mode, type:

To disconnect the directory with the open file name *C:\testshare*, regardless of who is accessing it, type:

To disconnect all open files on the remote computer srvmain that are being accessed by the user hiropln, regardless of their ID, type:

openfiles /query

Queries and displays all open files.

Syntax

Parameters

Parameter Description
/s Specifies the remote system to connect to (by name or IP address). Don’t use backslashes. If you don’t use the /s option, the command is run on the local computer by default. This parameter applies to all files and folders that are specified in the command.
/u [ \] Runs the command using the permissions of the specified user account. If you don’t use the /u option, system permissions are used by default.
/p [

] Specifies the password of the user account that is specified in the /u option. If you don’t use the /p option, a password prompt appears when the command is run. [/fo

]
Displays the output in the specified format. Valid values include:

  • TABLE — Displays output in a table.
  • LIST — Displays output in a list.
  • CSV — Displays output in Comma Separated Values (CSV) format.
/nh Suppresses column headers in the output. Valid only when the /fo parameter is set to TABLE or CSV.
/v Specifies that detailed (verbose) information be displayed in the output.
/? Displays help at the command prompt.

Examples

To query and display all open files, type:

To query and display all open files in table format without headers, type:

To query and display all open files in list format with detailed information, type:

To query and display all open files on the remote system srvmain by using the credentials for the user hiropln on the maindom domain, type:

In this example, the password is supplied on the command line. To prevent displaying the password, leave out the /p option. You’ll be prompted for the password, which won’t be echoed to the screen.

openfiles /local

Enables or disables the system Maintain Objects List global flag. If used without parameters, openfiles /local displays the current status of the Maintain Objects List global flag.

Changes made by using the on or off option don’t take effect until you restart the system. Enabling the Maintain Objects List global flag might slow down your system.

Syntax

Parameters

Parameter Description
[on | off] Enables or disables the system Maintain Objects List global flag, which tracks local file handles.
/? Displays help at the command prompt.

Examples

To check the current status of the Maintain Objects List global flag, type:

By default, the Maintain Objects List global flag is disabled, and the following message appears, INFO: The system global flag ‘maintain objects list’ is currently disabled.

To enable the Maintain Objects List global flag, type:

The following message appears when the global flag is enabled, SUCCESS: The system global flag ‘maintain objects list’ is enabled. This will take effect after the system is restarted.

To disable the Maintain Objects List global flag, type:

5 best software to open all types of files on Windows 10

  • The worst thing about having many files on your PC is not having the proper tools to open them all.
  • On that idea, we’ve compiled a list of the best software tools that can open pretty much any type of file.
  • To read more about this type of software, check out our dedicated File Opener Hub.
  • Further info can be acquired by accessing our website’s File Management page.

  • Unzip all major file formats: ZIP, RAR, 7Z, TGZ, TAR, etc.
  • Encrypts the files you zip for maximum protection
  • Manage your files easily (PC, Cloud, network)

Open archived files
with ease on your PC

There are many different types of files that you can open with multiple categories of software. For example, image editors open photo and graphic files, word processors open document (or text) files, PDF software opens PDFs and presentation applications open slideshows.

Most software packages are typically restricted to opening one or two types of files but support numerous formats for their file types. For example, most photo editors open JPG, PNG, GIF, BMP, TIFF, and other image formats.

Universal file openers (UFOs) are a rare breed of software that open (or display) a wide variety of different file types. They are programs that support a universal range of file types and most of their various file formats.

Note that universal file openers are typically restricted to opening files only, so most of them include only limited editing options if any. So a universal file opener is not a Word processor, spreadsheet, presentation, database, video editor and image editor application rolled into one!

Even though universal file openers generally lack editing options, it’s still worth adding one to Windows. If you can’t open a file with its default software, a UFO will probably open it.

Furthermore, with a universal file opener installed you won’t need so many programs to open alternative file types. These are some of the best software with which to open all types of files.

What are the best universal file opener software for your PC?

When it comes to archive files of all formats, no software tool is better than WinZip.

As a testimony to that matter, WinZip can open the following file format types in Windows 10: RAR, ZIP, ZIPX, 7Z, GZ, ISO, TAR GZ, TAR, IMG, TGZ, GZP, and XZ files. As for Mac, WinZip can manage RAR and ZIP files.

Besides the incredible versatility in terms of supported file formats, WinZip is an excellent overall file compressor, unzipper, encryption tool, password-protector, and transfer tool.

More so, this professional software is incredibly lightweight, integrates seamlessly with your Windows 10, and it is accessible for users of all experience levels.

Here are some of the perks of using WinZip:

  • A universal archive opener
  • Lightweight and easy-to-use
  • You can try it before you buy it
  • Works on both Windows and Mac

WinZip

File Viewer Plus 3

File Viewer Plus 2 is a UFO with which you can open more than 300 file formats. This is a flexible file viewer that also comes with a batch conversion utility for converting files to alternative formats.

File Viewer Plus 3 is retailing at a discounted $29.95 on the publisher’s website, and it’s compatible with Windows platforms from XP to 10.

File Viewer Plus 2 users can open a wide range of file types, such as presentation, text, spreadsheet, video, audio, archive, email, web, PDF, and source code.

The great thing about File Viewer Plus 2 is that it’s a little more than just a file viewer as you can also edit text, web, spreadsheet, and image files.

FVP 2 includes a few image-editing options for cropping, borders, color adjustment, and quick effects, and the software is also a relatively basic word processor and spreadsheet application.

As mentioned, File Viewer Plus 2 is a batch file converter; and you can also utilize it to extract archive files, such as ZIP, RAR, 7Z, TAZ, etc.

File Viewer Lite

File Viewer Lite is the freeware alternative to File Viewer Plus 3 from the same publisher. As such, this software is a file viewer only.

File Viewer Lite supports more than 150 file formats natively for various file types. You can open documents, audio, presentations, fonts, web pages, images, camera RAW files, spreadsheets, video, and audio file types with this universal file opener.

The software provides alternative native, hex, text and icon views for file contents and additional file info that you can export to text files. File Identifier, which identifies unknown files types, is also bundled with File Viewer Lite.

Universal Viewer

Universal Viewer is an intuitive universal file opener that can open most file types and formats.

There is not so much of a difference between them except that the Pro version includes image conversion options, supports RAW images, and includes a preinstalled PDF plugin.

Note that the freeware version doesn’t open MS Office documents with formatting included unless you have MS Office or one of the program’s Lister plug-ins installed. You can click Zip package on this page to download the freeware Universal Viewer.

Universal Viewer users can open an extensive range of image, audio, and video formats along with spreadsheets, PDFs, text documents, and web file types; but the software doesn’t support presentation files.

However, you can extend the software’s file type support with Lister plug-ins.

The software provides various viewing modes for its users, which include word wrap and encoding for text and center pictures and EXIF for images. Viewer also includes a few flip, rotate, grayscale, and sepia image-editing options.

Another good thing about UV is that it includes extensive UI, hotkey, and file display customization options on its settings window.

Ultra File Opener

Ultra File Opener is software that boasts support for more than 500 file formats. The software is compatible with 32 and 64-bit Windows platforms from XP up to 10.

This universal file opener supports an extensive range of formats for text, image, audio, video, and archive file types. However, you can’t open spreadsheets, PDF, web, or presentation files with Ultra File Opener.

So this program opens fewer types of files than some of the alternatives, but it does include a few handy extra tools.

For instance, you can extract archive files with the software, convert file formats and it includes a download manager with which users can resume downloads.

Furthermore, Ultra File Opener also provides extensive print settings for text and image documents with photo-printing templates included.

Those are four universal file viewers for Windows with which you can open a multitude of file formats for most file types, and they also include some handy additional options and tools.

WinZip is the best of the bunch as it includes more extensive editing options for text, spreadsheets, and image files than the others.

Aside from the above listed UFO software, you can also open numerous file types and formats with the DocsPal web app.

Читайте также:  Как запустить iperf mac os
Оцените статью