How to use msg command to send messages over network

Windows Msg command help and faq


Suitable for: Windows Vista, Windows 7, Windows 8, Windows 10
Windows Server 2008, Windows Server 2012, Windows Server 2016

Microsoft has removed net send command starting from Windows Vista and this command has been replaced by msg command (msg.exe), but only professional and business editions have ability to send network messages via msg command.

Msg command screenshot

Note: You can try our advanced replacement for msg command - LanTalk NET messenger with command line utility. LanTalk NET can send messages and even files via command line.

Usage

Msg command does not require messenger service to be enabled (since Windows Vista messenger service is removed from the system). Msg command has been designed to send messages to the terminal sessions on the same server or the other servers that you know. So, it's not very useful if you want to send messages to the different users on the different servers on the network in a random manner.


Full list of parameters and options of the msg command with variants of use is listed below:

msg username /server:servername /time:seconds /v /w /? messagetext

msg sessionname /server:servername /time:seconds /v /w /? messagetext

msg sessionID /server:servername /time:seconds /v /w /? messagetext

msg @filewithnames /server:servername /time:seconds /v /w /? messagetext

msg * /server:servername /time:seconds /v /w /? messagetext


Detailed description:

username - The target user name.

sessionname - The name of the session that was created by the administrator when the session was configured.

sessionID - The ID value of the session.

filewithnames - Path to file that contains a list of usernames, sessionnames, and sessionIDs to which to send the message.

messagetext - The text of the message you want to send to users (sessions etc.). If no message is found, standard input STDIN will be used to read the text for the message.

server:servername - Points to the terminal server. Current terminal server will be used if not specified.

time:seconds - Sets the waiting time before you receive confirmation from the target session that the message has been received.

w - Will wait for a response from the target user or users.

v - Displays detailed information about the each step of msg command.

? - Displays the help for syntax of the msg command and information about the options.


How to send messages with msg command

To send the message with text "lunch time" to all sessions of user RON, use this command in command prompt:
msg RON Lunch time?

If you want to send the message to all usernames that is stored in the file USERS, use this command:
msg @users Please logout in 10min due to server maintenance

When you have your message in the text file (message.txt) and you want to send it to PAUL, use this command:
msg PAUL < message.txt

If you want to send the message to all logged users, use this command:
msg * Please, save your work. Server maintenance!


Security Limitations

The user must have Message access permission for the session to be able to send the messages via msg command.


Troubleshooting

If you have any problems or receive an "access denied" error or "Error 5 getting session names" error while you trying to use msg.exe, try the following steps to fix the problem with msg command:

1. Open the Registry Editor ( regedit.exe ).

2. In the left panel, locate and then click on the following registry key: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server

3. In the right panel, find the key AllowRemoteRPC and be sure the value of the key is 1. If the value is not 1, change it to 1.

4. Close Registry Editor and restart your computer.

5. Run MSG.EXE command in the elevated CMD window. Launch it when you hold Ctrl+Shift keys to enter elevated mode.








 

Legal notices  |  Privacy Policy  |  About Us

1999 - 2020 © CEZEO software Ltd. All rights reserved.