msg: Send a message to a user.
The command: "msg" is on Windows 11, 10, .. available
The examples for the command "msg"
Here are some examples of using the `msg`
command in Command Prompt (CMD):
Example 1: Send message to a specific user:
msg username "Hello! This is a test message."
This command displays the message "Hello! This is a test message."
sent to the specified user with the username.
Example 2: Send message to all users on the computer:
msg * "Important notice: The server will be shut down in 10 minutes."
This statement sends the message "Important Notice: The server will be shut down in 10 minutes."
to all users on the computer.
Example 3: Send message to a remote machine:
msg /server:computername "This message is going to a remote computer."
Here the message "This message is going to a remote computer."
sent to a computer with the specified name.
Example 4: Send message with title:
msg username /time:30 "Notice" "Your appointment starts in 30 minutes."
This command sends a message titled "Notice"
to the specified user and contains the text "Your appointment starts in 30 minutes."
Example 5: Send message to a session:
msg username /v /w "This message requires your attention!"
Here an important message is sent with the `/w`
switch, which means the message waits for the user's session to be displayed. The `/v`
switch also outputs detailed information about the message.
Note: Note that the actual usage of the `msg`
command may vary depending on the system's security settings, and in newer versions of Windows there may be restrictions on the use of this command.
"msg" Excerpt from Microsoft Windows Help
Microsoft Windows [Version 10.0.19045.3693]
(c) Copyright 1985-2023 Microsoft Corp.
Send a message to a user.
MSG [/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 message to all sessions on specified server.
/SERVER:servername server to contact (default is current).
/TIME:seconds Time delay to wait for receiver to acknowledge msg.
/V Display information about actions being performed.
/W Wait for response from user, useful with /V.
message Message to send. If none specified, prompts for it
or reads from stdin.
Important information, tips for the "msg" command
Yes, there are some important aspects you should keep in mind when using the `msg` command in the Windows command line:
1. Admin Privileges: The `msg` command requires administrator privileges. You must run Command Prompt as administrator to use the command.
2. User Interaction: The `msg` command interacts with the user interface and can display messages on the screen. This may be undesirable if you want to disturb users.
3. Firewall and network settings: To use `msg` for remote notifications, the firewall settings must be configured correctly. Messages can also be blocked by network policies or antivirus programs.
4. System Policies: In newer versions of Windows, especially in corporate environments, Group Policy or Security Policies may restrict or disable the use of `msg`.
5. Not for Home Editions: The `msg` command may not be available on Home Editions of Windows.
6. Limited Support: In newer versions of Windows, `msg` is considered a deprecated or deprecated method for notifying users. Instead, alternative methods such as Toast notifications or PowerShell scripts are preferred.
7. Username vs. Session Name: When using the `msg` command, you may need to specify the username or session number correctly. Errors can occur if the user does not exist or is specified incorrectly.
8. Security Concerns: Sending messages to all users (`msg *`) can be considered a security risk and should be used with caution.
9. System Services: The `msg` command may not work with certain system services or in certain contexts, especially when it comes to notifications.
It is important to consider these aspects to ensure that the use of `msg` complies with your system's requirements and security policies. In many cases, more modern approaches such as PowerShell scripts or other notification methods may be more advisable.