Per artikel
Eenmalige toegang tot één artikel
€ 2,00 per stuk
Maandabonnement
Onbeperkte toegang, maandelijks opzegbaar
€ 30,00 per maand
Lifetime licentie
Eenmalig, permanente toegang
€ 1.000,00 eenmalig
Betalen via
Beveiligde verbinding · 256-bit TLS-encryptie
Betaling verwerken

Verbinding maken met betaalomgeving...

1 april kikker in je bil
5,005 views +0 -4

Close All Open Files

Command to close all open files for: Computer Management > Shared Folders > Open Files

for /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".

Note: The Server Service must be running in order for this command to work.