The Msg command is a command line application that comes with recent Windows versions and is used to send text messages to one or more users on the network. This command is available in Windows XP, 2003, Vista, 7, 8, 10 and is unavailable in Windows 95, 98, ME, NT, 2000.
The msg command replaces the net send command that was used in Windows NT, 2000, XP. Nevertheless, you can send and receive Net Send messages in Windows 10/8/7/Vista using third party software products (read more).
In order to send a message using Msg command, start a command prompt window. Type "msg" command with parameters according to the command syntax.
The Msg command has the following syntax:
msg {UserName | SessionName | SessionID| @FileName | *} [/server:ServerName] [/time:Seconds] [/v] [/w] [Message]
where
UserName - Specifies the name of the user that you want to receive the message;
SessionName - Specifies the name of the session that you want to receive the message;
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 RD 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, the message disappears. If no time limit is set, the message remains on the user's screen until the user sees the message and clicks OK;
/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 /time: 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.
If you do not specify a user or a session, msg displays an error message. When specifying a session, it must be an active one.
The user must have Message special access permission to send a message.
To send the message "Electricity will be cut off in 5 minutes" to all sessions for user John, type:
msg john Electricity will be cut off in 5 minutes
To send the same message to session CONSOLE, type:
msg console Electricity will be cut off in 5 minutes
To send the message to session 4, type:
msg 4 Electricity will be cut off in 5 minutes
To send the message to all sessions contained in the file MYUSERLIST, type:
msg @myuserlist Electricity will be cut off in 5 minutes
To send the message to all users who are logged on, type:
msg * Electricity will be cut off in 5 minutes
To send the message to all users, with an acknowledgment time-out of 20 seconds, type:
msg * /TIME:20 Electricity will be cut off in 5 minutes
2.3 Remarks on using the Msg command
2.4 The Msg command examples