Tag Archives: Bat Script Error

How to Solve Bat Script Error: system error 85 has occurred

A problem,
This error is thrown when using the BAT script to copy files from a remote server

System error 85 has occurred
The local device name is already in use

My script USES disk mapping, something like this

:: Delete the last set mapping
net use Y /delete /y
:: Disk mapping
net use Y: \\ServerName\shares \\ServerName\shares /user:password /persistent:yes

Without further explanation, Google System Error 85 with “NET USE” command for the simple reason that the remote server’s protection mechanism is involved

2. Solutions
There are two solutions, one is to modify the registry of the remote server, and the other is to operate directly locally
1. Modify remote server registry
Change the value of this path in the registry from 1 to 0

HKLM\System\CurrentControlSet\Control\SessionManager\ProtectionMode

For the terminal Server of Window Server 2003, the situation is quite special. Refer to the problem of 935642
2. Modify the native script
In fact, it’s easier to just delete all the disk mappings on your machine, rather than just deleting the definition, and click on the reference method

:: Delete all set disk mappings
net use * /delete /y