Portal for car enthusiasts

How to send a message via command line. Net send text message command

Existed in Windows 2000/XP and was intended for messaging between users logged in locally and users of terminal sessions (connected to a remote desktop). In Windows Vista and later operating systems in the Windows family, the MSG command has become the primary standard messaging tool because the command net send is no longer supported in these OSes.

Command line format:

MSG (<пользователь> | <имя сеанса> | | @<имя файла> | *} [<сообщение>]

Description of command line options:

<пользователь> Username. <имя сеанса> Session name. Session ID. @<имя файла> A file containing a list of usernames, sessions, or session IDs to which a message is sent. * Send a message to all sessions on the specified server. /SERVER:<сервер> Server (default - current). /TIME:<секунд> The interval for waiting for confirmation from the recipient. /V Display information about completed actions. /W Waiting for a response from the user, useful with /V. <сообщение> The message being sent. If not specified, a prompt is issued or input is taken from STDIN.

Important!

The current implementation of msg.exe is fine for exchanging messages between local and terminal user sessions within the same system, however, in cases of exchanging between different computers on a local network, you will need to change some of the default security settings in Windows Vista, 7 and 8 operating systems .

Usually, with standard settings, sending a message to a remote computer is not performed and is accompanied by a message

Error 1722 when getting session names

This means that it is not possible to obtain information about logged-in users on the computer where the message being sent is to be received. The reason may be that the firewall is blocking incoming connections, insufficient user rights in relation to the remote system, prohibiting remote procedure calls in the Terminal Server service settings. At a minimum, for messaging using the command msg between computers, you must have a user account that is valid with respect to the remote system and complete the following settings:

  • on each computer to which messages will be sent, add to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server parameter AllowRemoteRPC type REG_DWORD and equal 1 To change the settings, you can use the .reg file with the following content:

    Windows Registry Editor Version 5.00 "AllowRemoteRPC"=dword:00000001

    In Windows Vista, Windows 7, 8, 10Technical Preview registry key AllowRemoteRPC exists, but has a value equal to 0 which needs to be corrected. A reboot is required to apply the changes.

  • since the messaging utility msg.exe uses the SMB (Server Message Block) protocol, on each computer to which messages will be sent, a TCP port must be open 445

    Examples of using MSG:

    msg * /server:Server "Test message"- send a test message to all computer users server

    msg * /server:192.168.0.1 "Test message"- send a test message to all users of a computer with an IP address 192.168.0.1

    msg RDP-Tcp#0 /server:TSServer "Test message"- send a test message to the user of the terminal session with the name RDP-Tcp#0 on the computer TSServer

    msg console /server:Windows7 "Test Message"- send a test message to the current local computer user Windows7

    msg console "Test message"- send test message from RDP session user to local user. If this command is executed by a non-terminal session user, the message will be sent by the local user to itself.

    To execute a command msg on behalf of another user, you can use the utility PSExec from the package PSTools or standard tool runas.exe

    psexec -u otheruser -p otherpass msg * /server:win10 TEST message

    runas /user:otheruser "msg * /server:win10 Test message"

    Messages sent by the team msg to a local user of a computer running Windows XP that is not present (not yet logged into Windows) are displayed in a window with an invitation to register in the system and can be accessed by outsiders.

  • faced with the problem of informing users, the most common reason is updating 1C, in which it is necessary that all my users (and there are more than 160 of them) exit 1C and do not log in for some time. It would seem that it’s difficult, you can send a message by e-mail, as I used to do when I had office 365, but Yandex mail has its limitations: no more than 50 users on the mailing list. If you send to more users, then the letter will simply not reach some. Sending 50 users individually is not convenient. The second problem with Yandex mail is the need to enter captcha in some cases, the system perceives the mass mailing as spam, and the letters are necessary, if you do not warn the user, he will not be saved on time and there may be problems ...

    In general, it has become terribly inconvenient to send messages to all users. I started thinking about solutions.

    The first thing that came to mind: but a few inconveniences emerged:

    • Messages arrive in about 30 minutes for 160 jobs, which is a very long time.
    • The message appears only on the taskbar, if the user works via remote desktop, he will not see the message immediately.
    • It is necessary to maintain the operability of Kaspersky agents on the user's working machines, otherwise the message will not reach at all.

    The second option is to install some messenger, but here there are also several inconveniences.

    • There are a lot of messengers, they are not universal, you cannot send messages to each other between messengers.
    • Good messengers are paid.
    • Messages do not pop up on top of all windows, and if you need to report something urgent and important, then this is a useful feature of the message.
    • Installation and configuration of these same messengers is required, as well as user training for new software.

    I ended up on the windows command prompt, there are net send and msg commands to send messages to all computers on the local network. Everything works very simply, you open the command line, write a command, a message comes to the computer whose name you specified in the command text. Moreover, the message pops up on top of all windows, registration is not required, and everything is completely free.

    The command for sending messages to one computer on the local network looks like this:

    msg * /server:computername "Test message, click OK"

    I made a list of computers, then a little tedious work on creating the same type of commands in one txt file, but it's done quickly through copy-paste. The main thing is to make a list of computers. In a domain, this is done quite simply through the "Users and Computers" snap-in, right-click under the list of computers, then "Export List" immediately to a TXT file. Since I have about 160 computers in the domain, I approached the issue a little more creatively, did not do “copy-paste”, but did an auto-replacement of the first letter in the computer name in the already existing list of computers with msg * /server: + the first letter in the name of computers, for my luck it was the same for everyone. Similarly for the second part, but only with the last letter of the computer name (the last letter in the computer name + "Test message, click OK"), as a result I received a TXT file with a list of commands. I changed the file extension from txt to bat and launched it for execution. As a result, all computers in the domain received a "test message, click OK."

    Unfortunately, such a command does not work outside the domain, and since I completed the task, it was simply not rational to experiment further. I failed to send messages to computers in the workgroup, but I have only a few such computers. They can also send a message by mail, or in the same Kaspersky, or through some messenger. Let this be the topic for one of the following entries.

    As a result, what I got: 1 file in which you can quickly change the text of the message and with which I can send any message for free to everyone in the domain. It looks great, but there are still a couple of minuses:

    1. It is necessary to keep the file up to date, add new ones, delete non-existent computers.
    2. No immediate feedback.
    3. The file turned out to be ugly, I think it is possible to load the values ​​​​of the computer name from the file into this command, but there was no time to figure it out to the end.

    However, the pros outweigh all the cons:

    • Quick to implement, requires little to no preparation for the next shipment.
    • Reliably works, the user will definitely see this message.
    • For free.
    • Very, very simple, you just need to know one command and computer names.

    I will be glad to any comments, suggestions, comments)

    Team MSG net send

    Command line format:

    user- Username.
    session name- Session name.
    session ID- Session ID.
    @File name
    *
    /SERVER:server
    /TIME:seconds
    /V
    /W
    message

    Important!

    msg

    Parameter AllowRemoteRPC type REG_DWORD and equal 1

    AllowRemoteRPC 0

    msg.exe 445

    Examples of using MSG:

    server

    192.168.0.1

    TSServer

    Windows7

    To execute a command msg PSExec from the package PSTools or standard tool runas.exe

    msg

    MSG command - send a message to the user.

    Team MSG existed in Windows 2000/XP and was intended for messaging between users logged in locally and users of terminal sessions (connected to a remote desktop). In Windows Vista and later operating systems in the Windows family, the MSG command has become the primary standard messaging tool because the command net send is no longer supported in these OSes.

    Command line format:

    MSG (user | session name | session id | @filename | *)

    Description of command line options:

    user- Username.
    session name- Session name.
    session ID- Session ID.
    @File name— A file containing a list of usernames, sessions, or session IDs to which the message is sent.
    * - Send a message to all sessions on the specified server.
    /SERVER:server- Server (by default - current).
    /TIME:seconds— The interval for waiting for confirmation from the recipient.
    /V— Display of information about the performed actions.
    /W- Waiting for a response from the user, useful with /V.
    message— The message being sent. If not specified, a prompt is issued or input is taken from STDIN.

    How to send a message to all computers in the local network?

    Important!

    The current implementation of msg.exe is great for exchanging messages between local and terminal user sessions within the same system, however, in cases of exchanging between different computers on a local network, you will need to change some default security settings in Windows Vista, 7 and more operating systems later.

    With standard settings, sending a message to users of remote computers is not performed and is accompanied by a message:

    Error 1722 when getting session names

    This means that it is not possible to obtain information about logged-in users on the computer where the message being sent is to be received. The reason may be that the firewall is blocking incoming connections, insufficient user rights in relation to the remote system, prohibiting remote procedure calls in the Terminal Server service settings. At a minimum, for messaging using the command msg between computers, you must have a user account that is valid with respect to the remote system and complete the following settings:

    On each computer to which messages will be sent, add to the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server parameter AllowRemoteRPC type REG_DWORD and equal 1 To change the settings, you can use the .reg file with the following content:

    Windows Registry Editor Version 5.00

    "AllowRemoteRPC"=dword:00000001

    In Windows Vista, Windows 7, 8, 10 registry key AllowRemoteRPC exists, but has a value equal to 0 which needs to be corrected. A reboot is required to apply the changes.

    Since the messaging utility msg.exe uses the SMB (Server Message Block) protocol, on each computer to which messages will be sent, a TCP port must be open 445

    Examples of using MSG:

    msg * /server:Server "Test message"— send a test message to all computer users server

    msg * /server:192.168.0.1 "Test message"— send a test message to all users of a computer with an IP address 192.168.0.1

    msg RDP-Tcp#0 /server:TSServer "Test message"— send a test message to the user of the terminal session with the name RDP-Tcp#0 on the computer TSServer

    msg console /server:Windows7 "Test Message"— send a test message to the current local computer user Windows7

    msg console "Test message"- send test message from RDP session user to local user. If this command is executed by a non-terminal session user, the message will be sent by the local user to itself.

    To execute a command msg on behalf of another user, you can use the utility PSExec from the package PSTools or standard tool runas.exe

    psexec -u otheruser -p otherpass msg * /server:win10 TEST message

    runas /user:otheruser "msg * /server:win10 Test message"

    Messages sent by the team msg to a local user of a computer running Windows XP that is not present (not yet logged into Windows) are displayed in a window with an invitation to register in the system and can be accessed by outsiders.

    The entire list of CMD Windows commands

    MSG command - send a message to the user.

    Team MSG existed in Windows 2000/XP and was intended for messaging between users logged in locally and users of terminal sessions (connected to a remote desktop). In Windows Vista and later operating systems in the Windows family, the MSG command has become the primary standard messaging tool because the command net send is no longer supported in these OSes.

    Command line format:

    MSG (user | session name | session id | @filename | *)

    Description of command line options:

    user- Username.
    session name- Session name.
    session ID- Session ID.
    @File name— A file containing a list of usernames, sessions, or session IDs to which the message is sent.
    * - Send a message to all sessions on the specified server.
    /SERVER:server- Server (by default - current).
    /TIME:seconds— The interval for waiting for confirmation from the recipient.
    /V— Display of information about the performed actions.
    /W- Waiting for a response from the user, useful with /V.
    message— The message being sent. If not specified, a prompt is issued or input is taken from STDIN.

    Important!

    The current implementation of msg.exe is great for exchanging messages between local and terminal user sessions within the same system, however, in cases of exchanging between different computers on a local network, you will need to change some default security settings in Windows Vista, 7 and more operating systems later.

    With standard settings, sending a message to users of remote computers is not performed and is accompanied by a message:

    Error 1722 when getting session names

    This means that it is not possible to obtain information about logged-in users on the computer where the message being sent is to be received. The reason may be that the firewall is blocking incoming connections, insufficient user rights in relation to the remote system, prohibiting remote procedure calls in the Terminal Server service settings.

    Sending a message via command line to another computer

    At a minimum, for messaging using the command msg between computers, you must have a user account that is valid with respect to the remote system and complete the following settings:

    On each computer to which messages will be sent, add to the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server parameter AllowRemoteRPC type REG_DWORD and equal 1 To change the settings, you can use the .reg file with the following content:

    Windows Registry Editor Version 5.00

    "AllowRemoteRPC"=dword:00000001

    In Windows Vista, Windows 7, 8, 10 registry key AllowRemoteRPC exists, but has a value equal to 0 which needs to be corrected. A reboot is required to apply the changes.

    Since the messaging utility msg.exe uses the SMB (Server Message Block) protocol, on each computer to which messages will be sent, a TCP port must be open 445

    Examples of using MSG:

    msg * /server:Server "Test message"— send a test message to all computer users server

    msg * /server:192.168.0.1 "Test message"— send a test message to all users of a computer with an IP address 192.168.0.1

    msg RDP-Tcp#0 /server:TSServer "Test message"— send a test message to the user of the terminal session with the name RDP-Tcp#0 on the computer TSServer

    msg console /server:Windows7 "Test Message"— send a test message to the current local computer user Windows7

    msg console "Test message"- send test message from RDP session user to local user. If this command is executed by a non-terminal session user, the message will be sent by the local user to itself.

    To execute a command msg on behalf of another user, you can use the utility PSExec from the package PSTools or standard tool runas.exe

    psexec -u otheruser -p otherpass msg * /server:win10 TEST message

    runas /user:otheruser "msg * /server:win10 Test message"

    Messages sent by the team msg to a local user of a computer running Windows XP that is not present (not yet logged into Windows) are displayed in a window with an invitation to register in the system and can be accessed by outsiders.

    The entire list of CMD Windows commands

    Reference information about the net send command

    1. General information about the net send command
    2. Using the net send command
    3. Syntax of the net send command
    4. Notes on using the net send command
    5. Examples of using the net send command
    6. Enabling and disabling the messaging service and net send
    7. How to send net send messages in Windows 7

    Understanding the net send command

    Net send is a console application included with some versions of Windows for sending messages over a local network to another user, computer, or alias. The command is only available on Windows NT, 2000, XP, 2003 and is not available on Windows 7, Vista, ME, 98, 95 and older. In Windows XP, starting with Service Pack 2, the net send command is disabled by default.

    Using the net send command

    The Windows Messaging Service must be running for the net send program to work. In fact, the net send command is just a command-line interface to the messaging service, which is directly involved in sending and receiving messages. To be able to receive messages, the computer to which the message is sent must also be running a messaging service or another program that uses the same protocol for messaging. A message can only be sent to an active object on the network. If a message is sent to a user, the user must be logged in with their username.

    To send messages with the net send command, start a command interpreter (command prompt). To start the shell, select Run from the Start menu, type cmd, and then click OK. Use the net command with the send parameter and other parameters according to the command syntax. The messaging service displays received messages in a standard Windows message dialog box.

    Net send command syntax

    The net send command has the following syntax:

    net send (username | * | /domain | /users) message

    username- username, computer name or alias to which you want to send a message;

    * - sending messages to all members of a domain or workgroup;

    /domain- sending a message to all names in the computer's domain or in the domainname domain;

    /users— sending a message to all users connected to the server;

    message- Message text.

    Notes on using the net send command

    If the command parameter arguments contain spaces, they must be enclosed in quotation marks.

    There may be difficulties when using long names of message recipients. The names used by the messaging service are up to 15 characters long.

    Broadcast message length limit is 128 characters. The maximum length of personal messages is 1600 characters.

    Examples of using the net send command

    To send a message "You can send a message over the local network using the net send command" to the user ivanov, enter:

    net send ivanov You can send a message over the local network using the net send command

    To send a message to all users connected to the computer from which the message is being sent, type:

    net send /users Everyone immediately exit 1C!

    To send a message to all users in the ukmz domain, type:

    net send /domain:ukmz Electricity in the building will be turned off in 5 minutes

    To send a message to all users in the domain of the computer from which the message is being sent, type:

    net send * Gentlemen, the meeting with the CEO will take place at 13:00

    Enabling and disabling the messaging service and net send

    Enabling and disabling the messaging service is possible through both the MMC console (Services snap-in) and using the command line.

    To perform these operations, you must have administrator rights.

    To enable the messaging service using the MMC console, follow these steps: Go to the Control Panel. Open Administrative Tools, Services. Find "Messenger" in the list. Open the service properties window. Select 'Auto' from the 'Startup type' list if you want the service to start automatically when Windows boots. Then click the Start button. Click OK.

    To disable the messaging service, perform the following sequence of actions: Go to the Control Panel. Open Administrative Tools, Services. Find "Messenger" in the list. Open the service properties window. Select the 'Manual' value from the 'Startup type' list. Then click the Stop button. Click OK.

    To enable the messaging service from the command line, enter the following commands in the shell:

    sc config messenger start= auto
    net start messenger

    To disable the messaging service from the command line, enter the following commands in the shell:

    net stop messenger
    sc config messenger start= disabled

    How to send net send messages in Windows 7

    To send net send messages in those versions of Windows where this command is missing (Windows 7, Vista, ME, 95, 98), you can use third-party software.

    Sending messages using msg.exe

    We suggest you use two programs: WinSent Messenger and the Sent utility. WinSent Messenger is a LAN messenger compatible with net send. The Sent utility is designed to send messages from the command line. More detailed information is available on the pages of these software products:

    WinSent Messenger - messenger for local network

    Sent is a utility for sending net send messages from the command line in Windows 7/Vista.

    Is your company experiencing difficulties with communication within the team? Tired of calling every colleague to a meeting? Tired of walking around the office to solve the simplest issue? If you answered “yes” to at least one of these questions, then it's time to implement a corporate local messenger.

    Softros LAN Messenger is a simple and convenient office messenger - a program for exchanging messages on a local network of any size. Messenger for the company does not require and does not use an Internet connection and thus guarantees that the transmitted information will not go beyond the local network. The application is easy to install and use, has a nice, intuitive interface and works correctly for users with limited rights. For your convenience, the function of exchanging files between users of the network messenger is also provided. Fine-tuning allows the administrator to prohibit the use of certain application functions and changing its settings, which can be useful in a large company with a disparate infrastructure. Serverless messaging and file exchange allows you to save on hardware. 14 years of continuous improvement guarantee the quality and stability of our messenger for your local network.

    brief information

    Latest version: 9.2

    Supported OS: Windows 2000, Windows XP, Windows 2003, Windows Vista, Windows 2008, Windows 7, Windows 8.1, Windows 10, Windows 2012, Windows 2016

    Supported network types: LAN, WAN

    Key features of the Corporate Messenger:

    • Messaging with chat capability
      Create virtual chats within your network with any number of users.
    • Secure network communication
      Messages do not travel outside the local network.
    • Group messages on the local network
      Use bulk messaging to inform employees about upcoming events.
    • Quick Messages
      Set up up to 10 preset template messages with the ability to instantly send a hotkey, for quick responses with typical phrases or sentences.
    • Huge set of emoji emoticons
      Add mood to your messages with the built-in set of emoji emoticons (about 830 emoticons)
    • File transfer within the network, including bulk file sharing
      It has become much easier to exchange documents with colleagues.

      Net send in Windows 7

    • User grouping
      Assign your colleagues to departments or positions for ease of communication.
    • Remote Desktop Sharing
      Request remote assistance from your colleague or network administrator directly from the Messenger, giving him access to your desktop remotely. Ask your administrator to help you set up any programs or Windows on your computer, ask a colleague to help you with work issues.
    • Remote Desktop Administration
      Administrators authorized in the domain as domain administrators, or on a remote computer as local administrators, can connect to user desktops directly, bypassing connection permissions from the user.
    • User rights management
      The administrator can disable the use of any function if necessary.
    • Message history
      You will never lose a single message as they are all stored in the history files.
    • Serverless messenger architecture
      LAN Chat does not require the installation of a dedicated server.
    • No need for an Internet connection
      The LAN messenger works only within your company network and saves your subordinates from wasting time in ICQ, saving your traffic and minimizing the possibility of attacks.
    • Terminal Server Support
      LAN Messenger runs successfully on a terminal server from Microsoft or Citrix, and also supports multiple user sessions at the same time. (After installing Softros TS Engine.)
    • Easy to install
      You don't need any administrative skills to start using our program. Just install the internal messenger on every computer in your local network and it's ready to go.
    • Ease of Distribution
      After configuring network settings, as well as settings for user groups on one computer, you can export them to a file so that you can then use them on all computers within the company's network. This simplifies the setup of the program in complex networks.

    Top 10: LAN Chat

    Client-server messenger for local network. Integrates with Active Directory, multi-level contact list, bulletin board, mass notification system, conferences, SSL traffic encryption, offline message and file transfer, flexible user rights management system, file and folder transfer. Built-in Kanban boards for projects

    A client-server program for communicating in a corporate network that runs on the Windows OS platform. CommFort includes modules for chat, image sharing, file transfer, VoIP and video communication. Supports video conferencing up to 32 users

    Softros LAN Messenger

    A simple and reliable messenger for the local network. Does not require an internet connection. In addition to sending instant messages and transferring files, it allows you to create virtual rooms, do mass mailings, save message history, group contacts by department or position.

    Corporate mobile messenger in source codes. Includes Corporate mobile messenger in source codes

    Multimedia corporate messenger. Supports online status control, chat, voice and video communication, conferencing, video mail, screen-sharing.

    Msg command

    Works on PC, Mac and mobile platforms - iPhone, iPad, Nokia, Android and BlackBerry. Uses the open Jabber protocol (XMPP)

    Corporate client-server platform for real-time interaction and communication. Integration with Active Directory, access to the archive of all transferred messages and files, offline data delivery and assignment of documents to employees with strong encryption.

    Simple and fast multi-user chat with activity control on the local network. Designed for medium and small local networks (up to 300 computers). It does not require a dedicated server and can be quickly deployed even on a network without a professional administrator.

    Simple and powerful open source cross-platform client-server chat for local network and Internet.

    Free open-source cross-platform messenger for local network. Doesn't require a server. Message logging. File transfer.

    Free cross-platform chat for corporate networks. File transfer. Offline messages.

    Free instant messaging software for Microsoft Windows networks. High speed of message delivery to a large number of recipients (1000+)

    Check if the system supports the msg command. The functionality of this command is very similar to that of the unused net send command. But this command only works in professional and enterprise versions of Windows. If you're on Windows Home, upgrade to Professional or Enterprise to use the msg command.

    • For Windows version, click ⊞Win+Pause or right-click on "Computer" and select "Properties". The Windows version will appear under Windows Edition.

    Open a command prompt. Like net send , the msg command is run from the command line. The command prompt is launched in different ways (depending on the version of Windows), or just press ⊞ Win and type cmd.

    • Windows Vista/7: Open Command Prompt from the Start Menu.
    • Windows 8.1/10: Right-click the Start button and select Command Prompt.
    • Windows 8: click ⊞ Win + X and select Command Prompt.
  • Enter a command. Type msg and press Space. Next, you need to enter information that contains the text and direction of the message.

  • Specify the recipient of the message. Compared to net send , the msg command has additional options.

    • msg username - enter the name of a specific user.
    • msg session - enter the name of a specific session.
    • msg session ID - Enter the ID of a specific session.
    • msg @ filename - Enter the name of a file that contains a list of usernames, sessions, and/or session IDs. Useful for sending messages to department employees.
    • msg * - the message will be sent to all users who are connected to the server.
  • Specify the server whose users you want to send the message to (if you want). If you want to send a message to a user who is connected to another server, enter the server information after the recipient information. If no server is specified, the message will be sent to the current server.

    • msg * /server: server name
  • Set a time limit (if you want). You can set a time limit to specify the interval to wait for confirmation from the recipient. The temporary modifier is entered after the server information (if any).

    • msg * /time: seconds (e.g. 300 seconds for a five minute interval)
  • Enter your message text. After entering the various options, enter the message text. Or click ↵Enter, and the system prompts you to enter the text of the message on a separate line.

    • For example: msg @salesteam /server:EASTBRANCH /time:600 Congratulations on the increase in sales this quarter!
  • Send a message. To do this, click ↵Enter. The recipient will receive it immediately.

    • The msg command is designed to send messages to terminal users, not just different computers connected to the same network.
  • Troubleshoot. When working with msg, you may encounter the following errors:

    • "msg" is not recognized as an internal or external command, operable program or batch file. (msg is not recognized as an internal or external command, operable program, or batch file). In this case, the Windows version does not support msg . Upgrade Windows to Professional edition.
    • Error 5 getting session names or Error 1825 getting session names. An error occurred while communicating with the recipient. You can try to fix this problem by opening the registry editor on the recipient's computer (to do this, run the regedit command), go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server and change the value of the "AllowRemoteRPC" parameter from 0 to 1.
  • Team MSG existed in Windows 2000/XP and was intended for messaging between users logged in locally and users of terminal sessions (connected to a remote desktop). In Windows Vista and later operating systems in the Windows family, the MSG command has become the primary standard messaging tool because the command net send is no longer supported in these OSes.

    Command line format:

    MSG (user | session name | session id | @file name | *) [message]

    Description of command line options:

    user- Username.
    session name- Session name.
    session ID- Session ID.
    @File name- A file containing a list of usernames, sessions, or session IDs to which the message is sent.
    * - Send a message to all sessions on the specified server.
    /SERVER:server- Server (by default - current).
    /TIME:seconds- The interval for waiting for confirmation from the recipient.
    /V- Display information about the performed actions.
    /W- Waiting for a response from the user, useful with /V.
    message- The message to be sent. If not specified, a prompt is issued or input is taken from STDIN.

    Important!

    The current implementation of msg.exe is great for exchanging messages between local and terminal user sessions within the same system, however, in cases of exchanging between different computers on a local network, you will need to change some default security settings in Windows Vista, 7 and more operating systems later.

    With standard settings, sending a message to users of remote computers is not performed and is accompanied by a message:

    Error 1722 when getting session names

    This means that it is not possible to obtain information about logged-in users on the computer where the message being sent is to be received. The reason may be that the firewall is blocking incoming connections, insufficient user rights in relation to the remote system, prohibiting remote procedure calls in the Terminal Server service settings. At a minimum, for messaging using the command msg between computers, you must have a user account that is valid with respect to the remote system and complete the following settings:

  • on each computer to which messages will be sent, add to the registry key HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server parameter AllowRemoteRPC type REG_DWORD and equal 1 To change the settings, you can use the .reg file with the following content:

    Windows Registry Editor Version 5.00
    "AllowRemoteRPC"=dword:00000001

    In Windows Vista, Windows 7, 8, 10 registry key AllowRemoteRPC exists, but has a value equal to 0 which needs to be corrected. A reboot is required to apply the changes.

  • since the messaging utility msg.exe uses the SMB (Server Message Block) protocol, on each computer to which messages will be sent, a TCP port must be open 445

    Examples of using MSG:

    msg * /server:Server "Test message"- send a test message to all computer users server

    msg * /server:192.168.0.1 "Test message"- send a test message to all users of a computer with an IP address 192.168.0.1

    msg RDP-Tcp#0 /server:TSServer "Test message"- send a test message to the user of the terminal session with the name RDP-Tcp#0 on the computer TSServer

    msg console /server:Windows7 "Test Message"- send a test message to the current local computer user Windows7

    msg console "Test message"- send test message from RDP session user to local user. If this command is executed by a non-terminal session user, the message will be sent by the local user to itself.

    To execute a command msg on behalf of another user, you can use the utility PSExec from the package PSTools or standard tool runas.exe

    psexec -u otheruser -p otherpass msg * /server:win10 TEST message

    runas /user:otheruser "msg * /server:win10 Test message"

    Messages sent by the team msg to a local user of a computer running Windows XP that is not present (not yet logged into Windows) are displayed in a window with an invitation to register in the system and can be accessed by outsiders.