Close all open network files in a directory

There are certain cases when you need to close all open files in a given shared directory. Most people go into Computer Management under Shared Folders -> Open Files and close each file one at a time. This is OK for a small number of files, but when there are hundreds of files open, this is not practical.

SysInternals has created a utility called psfile.exe which is part of their PSTools package. Using this utility, you can match files using wildcards and close all of them.

Example:
psfile.exe D:\SomeShare\MyFolder\* -c

This command will close all open network files which match the expression D:\SomeShare\MyFolder\*.

PSTools Website (free to download)


Author: DPAK
Created: Sep 20 2005
Categories: Windows 2000 Server - Windows 2003 Server
TechByte #15

Warning: By visiting this site and/or by using any information contained herein, you agree to the Techbytes.ca terms of use.



Add a comment about this TechByte

If you wish to add a comment regarding this TechByte, please use the form below. Please note that by submitting comments using this form you are allowing all of the information submitted to be visible on this website. Any comments submitted using this form will only be shown on the website if they are approved by the administrators of this site. IF APPROVED, COMMENTS MAY TAKE SEVERAL DAYS TO BE POSTED.

Posted By: (Optional)

Comments:


Other TechBytes: