Introduction
In this article, we will discuss how to troubleshoot issues encountered when trying to mount a network share using the Net Use command with a password containing special characters, specifically the vertical bar character ("|").
Background
The Net Use command is a popular tool used in Windows operating systems to connect or disconnect network shares. However, users may encounter issues when trying to use this command with a password containing special characters. One such character is the vertical bar ("|"), which is commonly used in file paths and folder names.
Symptoms
When attempting to use the Net Use command with a password containing the vertical bar character, the following error message may appear:
System error 513 has occurred.
Access is denied.
This error occurs because the Net Use command does not support special characters in passwords. Therefore, it is necessary to troubleshoot this issue to allow users to connect to network shares using their passwords.
Resolution
To resolve this issue, you can use one of the following methods:
-
Method 1: Modify the Registry
This method involves modifying the registry to allow the Net Use command to use special characters in passwords. However, it is important to note that modifying the registry can be risky and may result in system instability if not done correctly.
- Press the Windows key + R to open the Run dialog box.
- Type
regeditand press Enter to open the Registry Editor. - Navigate to the following key:
- Right-click on the
Lsakey and select New > DWORD (32-bit) Value. Name the new valueDisableNetPasswordChange. - Double-click on the new value and set the value data to
0. - Click OK to save the changes and close the Registry Editor.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa -
Method 2: Use a Different Command
Instead of using the Net Use command, you can use the Net File command to connect to network shares with special characters in the password. This command supports special characters in passwords.
- Open a command prompt as an administrator.
- Type the following command:
- Replace
<sharename>with the name of the network share,with the username,with the password containing special characters, andwith the name of the server hosting the network share.
net file <sharename> /p:: @
In this article, we discussed how to troubleshoot issues encountered when trying to mount a network share using the Net Use command with a password containing special characters, specifically the vertical bar character ("|"). We provided two methods to resolve this issue: modifying the registry or using a different command (Net File). It is important to note that modifying the registry can be risky and should only be done by experienced users.