Page 1 of 1

net use delete - open file

Posted: 29 May 2019 12:26
by fisto

i have a batch script like this:

net use x: /delete

If there are open files from the network drive x, the cmd console ask whether the connection should still be disconnected (Y/N).

I know that I can force to disconnect the network drive (/yes), but I do not want that.

I would like to decide here what is done when a file is open and what is done when no file is open.

for example:

net use x: /delete
if there is an open file
do ...
if there is no open file
do ...

Is there a possibility here?

Thanks a lot and sorry for my bad english.