Identify Open Files and Forcibly Close Them
  • 1 Minute to read
  • Dark
    Light
  • PDF

Identify Open Files and Forcibly Close Them

  • Dark
    Light
  • PDF

Article Summary

Using third-party software, you can forcibly close files that are open on a gateway.

Use one of the following procedures to identify and close open files:

  • Using Microsoft PsTools
  • Using Microsoft openfiles
  • Using Microsoft Computer Management

Whether a procedure is successful depends on a number of factors such as firewall restrictions to the gateway from the Windows machine and file permissions.

Step-by-step guide

Using Microsoft PsTools

Before starting the procedure:

  1. Download to a local Windows computer PsTools from microsoft: https://docs.microsoft.com/en-us/sysinternals/downloads/psfile.
  2. Unzip the downloaded zip file and use either the Psfile or Psfile64 executable.

The default behavior of PsFile is to list the files on the local system that are open by remote systems.

https://docs.microsoft.com/en-us/sysinternals/downloads/psfile describes how to use the Psfiles and Psfiles64 programs.

To close files:

  1. Log on to the gateway that you want to check for open files.
  2. In the Configuration view, select Main > Activity in the navigation pane.
    The Activity Monitor page is displayed.
  3. Note the Source IP value from the Activity Sessions section of the Activity Monitor page.
  4. Run the Psfile or Psfile program using the Source IP value from the Activity Sessions section of the Activity Monitor page.
    For example, psfiles64 \\192.168.91.89 -u admin -p password 
    where password is the gateway admin user password.
  5. The program returns the open files on the remote gateway both with an ID for each open file and the path for the file.
  6. Rerun the Psfiles program using the -c flag with the ID or path of the files to forcibly close.

Using Microsoft openfiles

https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/openfiles describes how to use openfiles.

To close files:

  1. Open the Command Prompt window as an Administrator and run the openfiles program using the IP for the edge filer.
    For example, openfiles.exe /query /s 192.168.19.121
    The program returns the open files on the remote gateway with an ID for each open file.
  2. Rerun the openfiles program using the /disconnect parameter and the /id parameter with the file ID to forcibly close a file.

Using Microsoft Computer Management

To close files:

  1. Open Computer Management and click Actions > Connect to another computer.
  2. Enter the IP for the edge filer. 
  3. Drill-down to System Tools > Shared Folders > Open Files.
  4. Right-click on the file to close, and click Close Open File.

Was this article helpful?