JSI Tip 3486. How do I close all opened shared files on my 'server'?
Jerold Schulman
March 18, 2001
1 Min Read
If your clients regularly leave shared files open on your 'server', it would be nice to close them all, when needed.
In tip 0678 The NET FILE command, you learned how to close them one at a time.
NOTE: The NET FILES command only effects files opened from SMB (Server Message Block) clients. Files opened via HTTP, FTP, IPC or RPC are NOT affected. If a client was editing a shared file, closing it will loose the unsaved edits. The Server service must be running for NET FILE to function.
To close all open shared files, run CloseAll.bat, which contains:
@echo offfor /f "Skip=4 tokens=1" %%i in ('NET FILES') do if not "%%i" EQU "The" NET FILE %%i /CLOSE:end
About the Author
Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.
You May Also Like