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.