Discussion Locked

Batch file to disconnect Network drives

0 helpful
8 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I'm look to create a Macro and /or Batch file to disconnect and Map Network drives in windows not DOS because DOS will not disconnect an active drive. Any input you can provide will be greatly appreciated

8 replies

by eraser3498

I tried that first and get the message The Device is being accessed by an active process type NET HELPMSG 2404 for more info

by eraser3498

I tried that first and get the message The Device is being accessed by an active process type NET HELPMSG 2404 for more info

by eraser3498

I've tried net use x: /d/y and I received this message More help avalible by typeing NET HELPMSG 2404. Which state that the drive is in use and can't be unmapped.

by zaferus

Tough problem!

Windows officially doesn't support disconnecting a mapped drive with a process running (don't you know MS knows what's best for you?).

I'm not sure if you've tried a WSH script - but here is one that might help:

http://cis.stvincent.edu/wsh/disconnect.html

Couldn't find a utility to force this - but it may be hard for an app to get around an OS enforced rule.

I'm sure it's little consolation, but Linux supports something called "lazy" drive removal which will dismount a drive no matter what state it's in. Very useful!

This discussion is closed to new replies.