Solution:
Root Cause: Workstation Service Binding Collisions and System Error 85
System Error 85 (
ERROR_ALREADY_ASSIGNED /
The local device name is already in use) occurs when the Windows Workstation service (
lanmanworkstation) maintains an orphaned redirected drive definition in the kernel object directory (
\Device\LanmanRedirector) from a previous session. When the user logs in, File Explorer attempts to mount the SMB share using the same drive letter (e.g.,
Z:), but the OS kernel rejects the mapping because the drive letter string remains registered to an inactive session handle.
# Diagnostic Verification:
Open Command Prompt as Administrator and list low-level device redirections: cmd
net use
openfiles /query
Alternatively, execute in PowerShell: powershell
Get-WmiObject Win32_LogicalDisk | Where-Object { $_.DriveType -eq 4 } | Select-Object DeviceID, ProviderName, Status
If net use shows no drives mapped, but Get-WmiObject or subst shows Z: bound, a ghost redirection handle exists.# Step-by-Step Fix:
1. Purge Active SMB Session Handles and Drive Mappings:
Open Command Prompt as Administrator: cmd
net use * /delete /yes
2. Clear Stale Network Drive Registry Subkeys:
Open PowerShell as Administrator and run: powershell
# Remove ghost persistent mappings under HKCU\Network
Get-ChildItem -Path "HKCU:\Network" | Remove-Item -Recurse -Force
# Purge MountPoints2 registry cache
Get-ChildItem -Path "HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\MountPoints2" | Where-Object { $_.Name -like "##*" } | Remove-Item -Recurse -Force
3. Restart LanmanWorkstation Service:
Run in PowerShell: powershell
Restart-Service -Name "lanmanworkstation" -Force
4. Re-map the Persistent Network Drive correctly:
Execute: cmd
net use Z: \\server.domain.com\share /persistent:yes
# Prevention & Long-Term Monitoring:
Ensure scripts mapping drives always include explicit disconnection routines (net use Z: /delete) prior to invoking fresh mapping commands.