Software⏱️ 4 min read📅 2026-06-11

How to Fix Error 5 Error – MSG Command on CMD result Error 5 getting session names

Error 5 getting session names fix for MSG command on CMD

Quick Answer: Check if the Remote Procedure Call (RPC) is enabled and configured correctly, as it seems to be the issue with your Windows 10 Pro version 1607 setup.

The MSG command is used to send messages to users on other computers in a network. However, when you encounter an Error 5 getting session names while using the MSG command, it can be frustrating as it prevents you from sending messages to your colleagues or friends on another computer. In this guide, we will walk you through the troubleshooting steps to resolve this issue.

In addition to the technical aspects of resolving the error, understanding why it occurs is crucial. The MSG command relies on the Terminal Server feature, which allows remote access to a server's desktop session. If this feature is not enabled or configured correctly, the MSG command may fail with an Error 5 getting session names message.

🔍 Why This Happens

  • The first main reason for this error is that the AllowRemoteRPC registry value is set to 0, which prevents the MSG command from connecting to another computer's desktop session. To resolve this issue, you need to change the registry value to 1 and restart your computer.
  • An alternative reason for this error could be related to network discovery or file sharing settings. However, based on the provided information, it appears that these settings are already enabled on both computers.

🛠️ Step-by-Step Verified Fixes

Enabling RemoteRPC via Registry

  1. Step 1: Open the Registry Editor by typing `regedit` in the Run dialog box and pressing Enter. Navigate to the following key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\AllowRemoteRPC. Right-click on this key and select Modify. In the Value data field, change the value from 0 to 1. Click OK to save the changes.
  2. Step 2: Restart your computer to apply the changes. After restarting, try running the MSG command again with the same settings.
  3. Step 3: If you encounter any issues after enabling RemoteRPC, verify that your network discovery and file sharing settings are enabled on both computers.

Alternative Fix Method (Verify Network Discovery)

  1. Step 1: Check if the network discovery and file sharing settings are enabled on both computers. Ensure that the Private and Public networks have TURN ON enabled.
  2. Step 2: If you find any discrepancies in these settings, disable them temporarily and try running the MSG command again.
  3. Step 3: After verifying the network discovery and file sharing settings, re-enable them and attempt to send a message using the MSG command.

🎯 Final Words

By following these steps, you should be able to resolve the Error 5 getting session names issue when using the MSG command. Remember to verify that your network discovery and file sharing settings are enabled on both computers before attempting to send messages to another computer's desktop session.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions