net use delete - open file

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
fisto
Posts: 1
Joined: 29 May 2019 12:05

net use delete - open file

#1 Post by fisto » 29 May 2019 12:26

Hi,

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.

Post Reply