批处理关闭打开所有用户的文件
FileServer 2019。 我想关闭除一个用户外的所有打开文件。
for /f "skip=4 tokens=1" %%a in ('net files') do net files %%a /close
现在,我尝试将其文件排除在内,我看到用户存储在第三代币中。
for /F "skip=4 tokens=3" %%a in ('net files^|findstr /i "Andrew"') do echo %%a
但是,如果我只搜索用户名令牌,我不知道如何关闭文件。如何返回文件ID? 因此,我尝试了Net会话:
net session \\<ip> /delete
但是我从同一IP地址连接了几个用户,因此我无法使用此用户。 有什么想法吗?
Fileserver 2019.
I want to close all opened files except for one user.
for /f "skip=4 tokens=1" %%a in ('net files') do net files %%a /close
Now, I tried to exclude a specific user with its files, I see that the user is stored in third token.
for /F "skip=4 tokens=3" %%a in ('net files^|findstr /i "Andrew"') do echo %%a
But I don't know how to close a file if I'm searching only username token. How to return back to file id?
So I tried with net session:
net session \\<ip> /delete
But I have several users connected from the same IP address, so I cannot use this.
Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应向您显示要关闭的文件[理论],如果是的,请删除
echo
以激活的关键字。我相信,来自
Net Files
的代表性示例将使这个问题更容易回答。并非每个人都使用多用户环境。Should show you the files to be closed [theory] if so, remove the
ECHO
keyword to activate.A representative sample from
net files
would make this question easier to answer, I believe. Not everyone uses a multi-user environment.