0

Our end-user's mapped their own drive after login. Then, unmounted the network drive should be use net use /d U:/ in batch script but I want the network drive setting auto unmounted by schedule.

It may cause a problem: when user is uploading files to the network drive, the network drive will auto disconnect.

Example: While login, the batch executed to mount drive. After 5 minutes, the drive unmounted but the user is uploading files at this moment. This situation should not exist.

So, how to check in the batch script when user is transferring files to drive?

  • See task scheduler and `taskschd /?`. I think this is what you are looking for but your question isn't clear. Can you clarify? – Nico Nekoru Jun 11 '20 at 02:32
  • @NekoMusume Thank you for your advice. I try to edit the question again. – Timothy T.T Jun 11 '20 at 03:18
  • you can schedule a task with your batch file too: `schtasks /create /?` – Stephan Jun 11 '20 at 09:10
  • @Stephan how to avoid the schedule task while the user is using network drive? – Timothy T.T Jun 11 '20 at 09:44
  • you can't "avoid" a scheduled task, but you can schedule a batchfile, which does some checks before unmounting the drive. Question is: "how to check, if user is using the drive" and what do you consider "using". – Stephan Jun 11 '20 at 09:48
  • @Stephan Sorry for not being clear. "Using" refers to transfer files. So, how to check in the batch script, if the user is transferring file to drive. – Timothy T.T Jun 11 '20 at 10:03
  • when I think about it - how is that "auto-disconnect" implemented? Maybe curing the problem is easier than working around it. – Stephan Jun 11 '20 at 11:02
  • @Stephan Finally, I found a solution to solve this problem. To compare folder sizes before and after 5 minutes. If same file sizes at 5 minutes, it can disconnect network drive. – Timothy T.T Jun 12 '20 at 01:42

0 Answers0