|
The information in this article applies to:
SUMMARYThis article describes how to
close all open files on a Windows NT 4.0-based computer or Windows 2000-based
computer from the command line. You can use this command to close files on the
computer where the files reside, which you may find most useful when you run it
prior to backup procedures in environments where users do not log off,
disconnect, or close files prior to scheduled backup procedures. This command
only affects files that are open from SMB clients. It does not affect
interprocess communication (IPC) or remote procedure call (RPC) connections,
HTTP requests, or files that are in use by FTP clients.
MORE INFORMATIONCommand to Close All Open Filesfor /f "skip=4 tokens=1" %a in ('net files') do net files %a /close The command works by passing the file ID elements from the list produced by the net files command to the action argument of the for command, net files file ID /close. When you use the iterative substitution (%a in this case) as part of a batch file, the substitution needs to be %%a. For the batch file version of the command, use the following syntax: for /f "skip=4 tokens=1" %%a in ('net files') do net files %%a /close In both
cases, this command will appear to return an error because the last line of
output from net files is "The Command Completed Successfully" and there
is no file ID denoted as "The".
REFERENCESFor more information about these commands, from the command line type:
net help files
BY: Microsoft - 04/2002 |
|
Questions or problems regarding this web site
should be directed to Michael A. |