The msg command is a Command Prompt command that’s used to send a message to one or more users on the network using the Command Prompt.
When the command is triggered, a prompt is displayed on the machine(s) that it was sent to that shows the message as well as the sender’s username and the time that the message was sent.
It functions similarly to the net send command that was popular in Windows XP, but it’s not a true replacement for it. See Using the Msg Command to Replace Net Send further down the page.
Msg Command Availability
The msg command is available from within the Command Prompt in Windows 11, Windows 10, Windows 8, Windows 7, Windows Vista, and Windows XP.
It’s also available through the Command Prompt tool that’s accessible in Advanced Startup Options and System Recovery Options.
The availability of certain msg command switches and other command syntax may differ from operating system to operating system.
Msg Command Syntax
msg {username | sessionname | sessionid | @filename | *} [/server:servername] [/time:seconds] [/v] [/w] [message]
See How to Read Command Syntax if you’re not sure how to interpret the msg command syntax as it’s written above or described in the table below.
Msg Command Options | |
---|---|
Option | Explanation |
username | Use this option to specify a username to send the message to. |
sessionname | Specify sessionname to send a message to a specific session. |
sessionid | The sessionid option can be used to send a message to a session using the session’s ID. |
@filename | Use the @filename option to send a message to the user names, session names, and session ID’s listed in the specified file. |
* | The * option is used to send a message to every session on the servername. |
/server:servername | The servername is the server on which the username, sessionname, or sessionid, resides on. If no servername is specified, the message will be sent as directed to the server you’re executing the msg command from. |
/time:seconds | Specifying a time in seconds with the /time switch gives the msg command a length of time to wait for the receiver of the message to confirm receipt of it. If the receiver does not confirm the message in seconds number of seconds, the message will be recalled. |
/v | The /v switch enables the command’s verbose mode, which will display detailed information about the actions the msg command is taking. |
/w | This option forces the msg command to wait for a return message after you send a message. The /w switch is really only useful with the /v switch. |
message | This is the message you want to send. If you don’t specify a message then you’ll be prompted to enter one after executing the msg command. |
/? | Use the help switch with the msg command to show information about the command’s several options. |
Msg Command Examples
msg @myteam The Melting Pot at 1pm, on me!
In this example, the msg command is being used to tell a select number of users contained in the myteam file [@filename] connected to the server that there should be a meeting at The Melting Pot for lunch [message].
msg RODREGT /server:TSWHS002 /time:300
Here, we’ve used the command to send a message to RODREGT [username], an employee that connects to the TSWHS002 [/server:servername] server. The message is very time-sensitive, so we don’t even want him to see it if he hasn’t seen it after five minutes [/time:seconds].
Since a message wasn’t specified, the msg command will present a note at the prompt that says Enter message to send; end message by pressing CTRL-Z on a new line, then ENTER.
After entering a message for RODREGT, you’d press the Enter key, then CTRL+Z, then Enter again.
msg * /v Test Message!
In the above example, we’re sending everyone connected to the server a test message [message]. We also want to see the specific tasks that the msg command is performing to do this [/v].
This is an easy example you can try at home, with no users connected to your computer. You’ll see the message pop up on your own screen and the following data in the Command Prompt window, thanks to using the verbose switch:
Sending message to session Console, display time 60
Async message sent to session Console
Using the Msg Command to Replace Net Send
The msg command is intended to be used as a messaging system to terminal server users, not necessarily between two Windows 7 computers, for example.
In fact, you might have a difficult time getting it to work between two standard Windows machines like the net send command did. You might get an «Error 5 getting session names» or an «Error 1825 getting session names» message.
However, some have had luck using the msg command in this way by changing the AllowRemoteRPC registry value data from 0 to 1 on the computer receiving the message (reboot the computer after the change if you do this). This key is located in the Windows Registry under the HKEY_LOCAL_MACHINE hive at this location: SYSTEM\CurrentControlSet\Control\Terminal Server.
Msg Related Commands
The msg command is a networking command, so it might be used with other network-related commands, but generally, it’ll be used alone to send a message.
Also, as mentioned a few times, this command is similar to the retired net send command.
Thanks for letting us know!
Get the Latest Tech News Delivered Every Day
Subscribe
The `msg` command in Command Prompt allows users to send messages to other users on the same network or terminal session.
Here’s a code snippet demonstrating the usage of the `msg` command:
msg * Hello, this is a test message!
Understanding the cmd msg Command
What is the cmd msg Command?
The cmd msg command is a built-in utility in Windows operating systems that allows users to send messages between users connected to the same network or across different sessions on a single computer. This command is particularly useful in environments where multiple users are logged in simultaneously—such as in server management or collaborative workspaces—because it enables instant communication without requiring third-party tools.
When to Use the msg Command
You might find the cmd msg command handy in several scenarios, including:
- System Admin Alerts: Notify users about server maintenance or system updates.
- Quick Communications: Enable team members to share important information without using emails or chat applications.
- Remote Messaging: Send updates or alerts to users logged into remote machines.
By using the cmd msg command, you can establish a quick method of communication that is integrated right into the operating system, streamlining interactions.
Mastering Cmd Dos Commands: A Quick Guide
How to Use the cmd msg Command
Basic Syntax of the msg Command
The basic syntax of the cmd msg command allows you to send a straightforward message to users or sessions. The structure follows this pattern:
msg <session> <message>
Where:
- `<session>` refers to the session ID or username of the target recipient.
- `<message>` is the text that you want to send.
Common Parameters Explained
session
The session parameter specifies whom the message is being sent to. You can send a message to specific users or all users logged on to a machine. To find out session IDs, you can use the `query user` command like so:
query user
This command returns a list of active sessions, showing details such as username, session name, and session ID.
message
The message parameter is the actual text you wish to convey. You can format your message to ensure it stands out or clearly communicates your intention.
Displaying a Simple Message Using cmd msg
To send a simple message to all users, you can use the «asterisk» wildcard. Here’s an example:
msg * Hello, this is a test message!
Upon execution, every user logged into the machine will receive the message «Hello, this is a test message!» in their session.
Mastering The Cmd Run Command: A Quick Guide
Advanced Usage of cmd msg Command
Sending Messages to Specific Users
To deliver messages to particular users, you can specify their usernames directly in the command. Here’s how to do it:
msg username Hello, please check the server status!
In this case, replace `username` with the actual username of the recipient. The message will prompt only that specific user.
Broadcasting Messages to All Users
Broadcasting a message to all logged-in users can be beneficial for general alerts. Use this command:
msg * Important: System maintenance will occur at midnight.
By using the wildcard `*`, you ensure that the message reaches every user connected to the computer.
Using the msg Command in a Network Environment
In a networked environment, you might need to send messages to users on different machines. To do this, use the `/server` switch to specify the computer name:
msg /server:computername username "This is a network message."
Replace `computername` with the target machine’s name and `username` with the recipient’s name. Ensure that you have the necessary permissions to send messages over the network.
Mastering Cmd DNS Commands: A Quick Guide
Troubleshooting Common Issues with cmd message
Permissions Issues
Permissions can impede the successful delivery of messages. If you encounter errors, check if you have administrative privileges. Only users with sufficient rights can send messages on certain network configurations.
A quick way to resolve this is to run your command prompt as an administrator. Right-click on the Command Prompt icon and select «Run as administrator» before executing your command.
Message Not Received
If a message fails to appear on a recipient’s screen, it could be due to several reasons:
- Target User Not Logged In: Ensure the intended recipient is actively logged in to the session.
- Firewall Restrictions: Sometimes, security settings can block messages; check the settings for any active firewalls that might be filtering message traffic.
Mastering The Cmd IP Command: Quick And Simple Guide
Alternative Commands to cmd msg
Comparing msg cmd with Other Messaging Options
While the cmd msg command is an effective messaging tool, other options exist in Windows Command Line. For example:
- net send: Although largely outdated and decommissioned in newer versions of Windows, this command historically allowed messaging on local networks.
- PowerShell Write-Host: In a PowerShell environment, you can output messages, but it’s not designed for direct user messaging.
Using cmd msg is generally preferred for its simplicity and targeted delivery capabilities.
Mastering The Cmd List Command: Quick Tips For Success
Conclusion
The cmd msg command is an invaluable tool for efficient communication within various user sessions on Windows machines. Its ability to facilitate quick and straightforward messaging can enhance collaboration, especially in multi-user environments. By practicing the various command structures and utilizing its extensive capabilities, users can harness the power of direct communication effectively.
Cmd Best Commands: Your Quick Guide to Mastery
Additional Resources
For thorough understanding and more advanced techniques, consider exploring:
- Official Microsoft documentation on the cmd msg command.
- Community forums focused on command-line utilities.
- Tutorials on advanced command prompt functions.
Mastering Cmd Del Command for Effective File Management
FAQs About the cmd msg Command
Can I use the msg command on Windows Server?
Yes, the cmd msg command is compatible with Windows Server editions. It can be particularly useful in managing user messages on a server.
What type of messages can be sent using cmd msg?
The cmd msg command can send plain text messages. However, consider the limitations that may apply based on system policies or configurations.
Is there a way to schedule messages using cmd?
While the cmd msg command doesn’t directly support scheduling, you can use the Task Scheduler to automate tasks that include sending messages at specified times.
When you have computers connected over a network, it is possible to send a message to them without using any software. The process works in a similar way to how data is sent from one computer to another. Windows offers MSG or messaging tool which operates from the Command Prompt. In this post, we will discuss how you can send message to an IP address or user from the Command Prompt.

MSG Command Syntax to Send Message to IP or User
MSG {username | sessionname | sessionid | @filename | *} /SERVER:servername /TIME:seconds /V /W [message]
- username Identifies the specified username.
- sessionname The name of the session.
- sessionid The ID of the session.
- @filename Identifies a file containing a list of usernames,
sessionnames, and sessionids to send the message to. - * Send a message to all sessions on the specified server.
- /SERVER:servername server to contact (default is current).
- /TIME: seconds Time delay to wait for the receiver to acknowledge msg.
- /V Display information about actions being performed.
- /W Wait for a response from the user, useful with /V.
- message: Message to send. If none specified, prompts for it or reads from stdin.
How to send a message to an IP address or a Windows 11/10 PC from Command Prompt
MSG command helps you to send a message to a specific user on a particular computer. If you are an admin, you can use the command syntax to figure out the exact username.</
- Open Command Prompt with admin privileges. (Type CMD in the search and launch it with admin permissions)
- Make sure to keep the username, server name, etc. are with you.
- Type MSG <username> or
msg * /server:computername message
and press the Enter key - It will let you type any number of the message unless you hit control + z
- Once you type the message, press the Enter key, and it will send the message.
The message should be received on the other side if messaging services are set up in the form of a pop-up window. The user, on the other side, can also use the same method to send a message.
Earlier to Windows 11/10, it was possible to use the NET command to send messages to a particular IP address, but it has been deprecated.
How Can I Find the IP Address of Another Computer?
- Open Windows Terminal by making a right-click on the Start menu and then clicking on it
- Type nslookup and the domain name of the computer
- It will reveal the IP address instantly.
How to send multiple line messages to another Windows PC?
- First, write the message in a text file, and save it. Make sure to note the location.
- Open Windows Terminal, and execute the command.
type \fullpath\multiplelinemessages.txt | msg * /server:computername
It will open the pop-up window, and the message will be displayed as you wrote it.
How Do I Send Messages to Another Computer Using PowerShell?
You can use the following script:
$name = read-host "Enter computer name " $msg = read-host "Enter your message " Invoke-WmiMethod -Path Win32_Process -Name Create -ArgumentList "msg * $msg" -ComputerName $name
I hope the post was easy to follow, and you are now able to secretly send the message to computers on your network or send a message to IP addresses or a User.
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Sign up
Appearance settings
- Details
- Category: Windows
-
-
Hits: 13099
Msg is a command for sends a message to a user on a Remote Desktop Session Host server.
MSG command syntax
The msg command has a large number of possible options which makes it very powerful and flexible.
The syntax of the msg command is as follows:
Syntax
msg {<username> | <sessionname> | <sessionID>| @<filename> | *} [/server:<servername>] [/time:<seconds>]
[/v] [/w] [<message>]
Msg Options |
|
PARAMETER |
DESCRIPTION |
<username> |
Specifies the name of the user that you want to receive the message. If you don’t specify a user or a session, this command displays an error message. When specifying a session, it must be an active one. |
<sessionname> |
Specifies the name of the session that you want to receive the message. If you don’t specify a user or a session, this command displays an error message. When specifying a session, it must be an active one. |
<sessionID> |
Specifies the numeric ID of the session whose user you want to receive a message. |
@<filename> |
Identifies a file containing a list of user names, session names, and session IDs that you want to receive the message. |
* |
Sends the message to all user names on the system. |
/server: <servername> |
Specifies the Remote Desktop Session Host server whose session or user you want to receive the message. If unspecified, /server uses the server to which you are currently logged on. |
/time: <seconds> |
Specifies the amount of time that the message you sent is displayed on the user’s screen. After the time limit is reached, |
/v |
Displays information about the actions being performed. |
/w |
Waits for an acknowledgment from the user that the message has been received. Use this parameter with |
<message> |
Specifies the text of the message that you want to send. If no message is specified, you will be prompted to enter a message. To send a message that is contained in a file, type the less than (<) symbol followed by the file name. |
/? |
Displays help at the command prompt. |
Note
You must have Message special access permission to send a message.
Examples
To send a message entitled, Let’s meet at 1PM today to all sessions for User1 , type:
msg User1 Let's meet at 1PM today
To send the same message to session modeM02 , type:
msg modem02 Let's meet at 1PM today
To send the message to all sessions contained in the file userlist, type:
msg @userlist Let's meet at 1PM today
To send the message to all users who are logged on, type:
msg * Let's meet at 1PM today
To send the message to all users, with an acknowledgment time-out (for example, 10 seconds), type:
msg * /time:10 Let's meet at 1PM today