문제

I'm running a robocopy script to backup a server and I'm using net stop and taskkill to terminate services and processes that could cause the script to fail or miss important files, but how do I close any open files or folders on network shares (in case a client PC left stuff open when they went home)??

도움이 되었습니까?

해결책

There are two ways you can do this easily via a batch script:

NET SESSION \\computername /delete

or

SC RESTART LanmanServer

The first terminates all sessions for the specified computer name. The latter stops and restarts the file server, which would effectively terminate all sessions.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top