Can I programmatically find out if a drive is in use?

Posted by Geo on Stack Overflow See other posts from Stack Overflow or by Geo
Published on 2010-06-02T07:21:12Z Indexed on 2010/06/02 7:23 UTC
Read the original article Hit count: 200

Filed under:
|
|

Is there any way of programmatically finding out if a mapped drive is currently in use? If I try to unmount the drive with net use, and the drive is being used, it will tell me that the drive is in use and prompt me to take further action.

I'd like to be able to unmap drive automatically if it's no longer being used. The system is a Windows XP.

© Stack Overflow or respective owner

Related posts about Windows

Related posts about mapped-drive