Msg |
Applies To: Windows Vista,Windows Server 2008
Sends a message to a user on a terminal server.
For examples of how to use this command, see Examples.
Syntax
Copy Code |
|
msg {<UserName> | <SessionName> | <SessionID>| @<FileName> | *} [/server:<ServerName>] [/time:<Seconds>] [/v] [/w] [<Message>] |
Parameters
Parameter |
Description |
<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 terminal 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 acknowledgement from the user that the message has been received. Use this parameter with /time:<Seconds> to avoid a possible long delay if the user does not immediately respond. Using this parameter with /v is also helpful. |
<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. |
Remarks
- 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.
Examples
- To send the message entitled "Let's meet at 1PM today" to all sessions for User1, type:
Copy Code |
|
msg User1 Let's meet at 1PM today |
- To send the same message to session MODEM02, type:
Copy Code |
|
msg modem02 Let's meet at 1PM today |
- To send the message to session 12, type:
Copy Code |
|
msg 12 Let's meet at 1PM today |
- To send the message to all sessions contained in the file USERLIST, type:
Copy Code |
|
msg @userlist Let's meet at 1PM today |
- To send the message to all users who are logged on, type:
Copy Code |
|
msg * Let's meet at 1PM today |
- To send the message to all users, with an acknowledgment time-out (for example, 10 seconds), type:
Copy Code |
|
msg * /TIME:10 Let's meet at 1PM today |
Additional references
Terminal Services Command Reference