I am working on a batch script to remap a network drive in windows xp. I have found it to work out well for the most part with:
net use G: /delete net use G: \\file\share
However, if there are any connections to the drive, it will prompt:
There are open files and/or incomplete directory searches pending on the connection to G:.
Is it Ok to continue disconnecting and force them closed? (Y/N) [N]:
What would be the most graceful way of allowing for this dialog? Is there ever a case where forcing a disconnect would lead to trauma? Is there an alternative method of closing the connections, outside of deleting outright? Kick everything off the drive?