Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a script running on Windows 7 Professional SP1 x64 that maps the first available network drive to a network resource, uses it, and then deletes the mapping.

Unfortunately, after deleting the mapping, the script still does not show the drive letter as being available for the next usage.

Drives are mapped by the NET USE command:

net use A: \\server.mycorp.com\network\resource /persistent:no /user:MYCORP\username password

Drives are unmapped by the same NET USE command:

net use A: /delete

I find the used drive letters by the WMIC command:

wmic logicaldisk get caption | findstr /r /v "^Caption ^$"

Can anybody explain why the WMIC command shows drive letters that have been returned to the system after the net use /delete command as still being used?

Thanks, PaulH

EDIT

The fsutil fsinfo drives command also shows the unampped drive as still in use.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.