Msg windows 10 пример

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

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.

Send Message to IP Address

MSG Command Syntax to Send Message to IP or User

MSG {username | sessionname | sessionid | @filename | *}
/SERVER:servername /TIME:seconds /V /W [message]
  1. username Identifies the specified username.
  2. sessionname The name of the session.
  3. sessionid The ID of the session.
  4. @filename Identifies a file containing a list of usernames,
    sessionnames, and sessionids to send the message to.
  5. * Send a message to all sessions on the specified server.
  6. /SERVER:servername server to contact (default is current).
  7. /TIME: seconds Time delay to wait for the receiver to acknowledge msg.
  8. /V Display information about actions being performed.
  9. /W Wait for a response from the user, useful with /V.
  10. message: Message to send. If none specified, prompts for it or reads from stdin.

Send Message to IP or User

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.

How to use msg command to send messages over network

Windows Msg command help and faq

Suitable for: Windows Vista, Windows 7, Windows 8, Windows 10
Windows Server 2008, Windows Server 2012, Windows Server 2016

Microsoft has removed net send command starting from Windows Vista and this command has been replaced by msg command (msg.exe), but only professional and business editions have ability to send network messages via msg command.

Msg command screenshot

Note: You can try our advanced replacement for msg command — LanTalk NET messenger with command line utility. LanTalk NET can send messages and even files via command line.

Usage

Msg command does not require messenger service to be enabled (since Windows Vista messenger service is removed from the system). Msg command has been designed to send messages to the terminal sessions on the same server or the other servers that you know. So, it’s not very useful if you want to send messages to the different users on the different servers on the network in a random manner.

Full list of parameters and options of the msg command with variants of use is listed below:

msg username /server:servername /time:seconds /v /w /? messagetext

msg sessionname /server:servername /time:seconds /v /w /? messagetext

msg sessionID /server:servername /time:seconds /v /w /? messagetext

msg @filewithnames /server:servername /time:seconds /v /w /? messagetext

msg * /server:servername /time:seconds /v /w /? messagetext

Detailed description:

username — The target user name.

sessionname — The name of the session that was created by the administrator when the session was configured.

sessionID — The ID value of the session.

filewithnames — Path to file that contains a list of usernames, sessionnames, and sessionIDs to which to send the message.

messagetext — The text of the message you want to send to users (sessions etc.). If no message is found, standard input STDIN will be used to read the text for the message.

server:servername — Points to the terminal server. Current terminal server will be used if not specified.

time:seconds — Sets the waiting time before you receive confirmation from the target session that the message has been received.

w — Will wait for a response from the target user or users.

v — Displays detailed information about the each step of msg command.

? — Displays the help for syntax of the msg command and information about the options.

How to send messages with msg command

To send the message with text «lunch time» to all sessions of user RON, use this command in command prompt:
msg RON Lunch time?

If you want to send the message to all usernames that is stored in the file USERS, use this command:
msg @users Please logout in 10min due to server maintenance

When you have your message in the text file (message.txt) and you want to send it to PAUL, use this command:
msg PAUL < message.txt

If you want to send the message to all logged users, use this command:
msg * Please, save your work. Server maintenance!

Security Limitations

The user must have Message access permission for the session to be able to send the messages via msg command.

Troubleshooting

If you have any problems or receive an «access denied» error or «Error 5 getting session names» error while you trying to use msg.exe, try the following steps to fix the problem with msg command:

1. Open the Registry Editor ( regedit.exe ).

2. In the left panel, locate and then click on the following registry key: HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ Terminal Server

3. In the right panel, find the key AllowRemoteRPC and be sure the value of the key is 1. If the value is not 1, change it to 1.

4. Close Registry Editor and restart your computer.

5. Run MSG.EXE command in the elevated CMD window. Launch it when you hold Ctrl+Shift keys to enter elevated mode.

Details
Category: Windows

Hits: 13037

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,
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:<*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. 

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

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Windows 7 конец продаж
  • Как вернуть магазин приложений в windows 10
  • C windows servicing lcu можно ли удалить
  • Genius wizardpen 4x3 windows 7
  • Bios setup utility настройка для восстановления windows