Windows – Can’t disconnect a mapped drive on a server

I was running into a frustrating issue where I had mapped a drive using a script and I could not disconnect anymore ? Sad smile

image

Problem was that I could not open the mapped drive because in the background it was not available anymore ?

clip_image002

But when I tried to run a script to disconnect the drive. I saw a different message

clip_image004

So I now knew that the Z: drive was being locked by an other process.

Error : The device is in use by an active process and cannot be disconnected.

Firing up the Process Explorer revealed after searching on the keyword “Z:” the process ID 7936 was locking the drive ?

clip_image006

Pulling up a bit more details said that the WebClient service was involved.

Restarting the service gave me back the drive letter Smile

clip_image008

 

clip_image010

I could then map the Z: drive again via a script and disconnect again, without having to restart the server each time.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: