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.

Msg Command Syntax

msg {username | sessionname | sessionid | @filename | *} [/server:servername] [/time:seconds] [/v] [/w] [message] 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. 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:

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.

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.