Recently, when writing batch processing of FTP upload data, I needed to use data transmission in the LAN to prompt an error. I suddenly remembered that I forgot the command (net send) that I had been using for a long time. As a result, I ran net send /? under win7. After searching by Baidu Master, it turned out that the net send command was cancelled by Microsoft after vista. Once again, you can use the MSG command to send messages on the WIN 7 local area network. I searched in the jar for a long time but couldn't find a real way to use it. I finally got it done on Baidu and Google. I posted it for everyone to see it. . . . .
MSG system comes with help
C:\Windows\system32>MSG
Send the message to the user.
MSG {username | sessionname | sessionid | @filename | *}
[/SERVER:servername] [/TIME:seconds] [/V] [/W] [message]
username �
sessionname �
sessionid �
@filename
*
/SERVER:servername The server to contact (the default value is the current value).
/TIME:seconds The time delay waiting for the receiver to confirm the message.
/V �
/W �
message Message to be sent. If not specified, issue a prompt, or read from stdin.
The following codes are tested in the start--execution-----------------------------------------------------------------------------------------------------------------
Test conditions: Local IP: 192.168.1.200 Test computer IP: 192.168.1.201 It is within the same LAN and can be pinged.
1. Perform local adjustment test and verification according to the above MSG usage method. MSG /server:192.168.1.200 * "Hello" ------------------->>>> The run is successful and a message dialog box pops up.
2. Then perform communication verification of two computers in the LAN. MSG /server:192.168.1.201 * "Hello" --------->>>> Running failed with an error. Error 1722 when getting session name.
3. Again, Baidu, there is a way to modify the registry in CSDN. In CMD, the registry HKEY_LOCAL_MACHINE\SYSTEM\CURRENTCONTROLSET\CONTROL\TERMIMAL SERVER The value of ALLOWREMOTERPC in SERVER is changed to 1 (default is 0). Because the net send command needs to enable the Messenger messenger service under the XP system, but there is no such service in win7, so the registry needs to be modified so that the win7 system can send information on the local area network, which can be similar to XP.
4. The verification still fails at this time. Turn off the test computer and the firewall of the machine, and modify the registry of the test computer as above. Verify again. MSG /server:192.168.1.201 * "Hello" failed to run, an error reported. 192.168.1.201 does not exist or the connection failed. . . Finally, I searched and found the final answer with GOOGLE. . Open the control panel, double-click the credential manager, click Add Windows credentials, write the IP address of the test computer in the first line, write the user name of the test computer in the second line, write the password of the test computer in the third line, restart the computer, run --cmd------------MSG /server:192.168.1.201 * "Hello" ------------->>> The run was successful. . .
The final answer of Google search (in English, some basic English can be understood) Link:/Forums/windows/en-US/344aa708-5477-46f9-be4f-ad8b3b2348b0/sending-a-message-to-win-7-host-with-msgexe?forum=w7itprogeneral
1 go to credential manager
2 click add a windows credential
3 type the name of the computer, username and password of the computer that you are trying to contact
4 computers that you are trying to contact most be in the same network as you.
good luck it took me months to get it properly working
During the above learning process, I found that it is OK. Enter \\192.168.0.201 in cmd and then press Enter the car, and the dialog box pops up to enter the account number and password.
There is a check option below, to record the account and password. If you check this item, the corresponding windows credentials will be automatically added in the credential manager.
Below are the additions from other netizens
Send a message to the user. The message will pop up in a prompt box
MS-DOS command syntax
msg {UserName|SessionName|SessionID|@FileName|*} [/server:ServerName] [/time:seconds] [/v] [/w] [message]
MS-DOS command parameters
UserName
The name of the user to receive the message.
SessionName
The name of the session to receive the message.
SessionID
The digital ID of the session whose user wants to receive the message.
@FileName
Identifies a file containing the username, session name, and session ID list of messages to be received.
*
Send messages to all users in the system.
/server:ServerName
Specifies the session to which the message is to be received or the terminal server to which the user belongs. If not specified, /server will use the server you are currently logged in.
/time:seconds
Specifies the time when the message you send appears on the user's screen. Once expired, the message disappears from the screen. If no expiration is set, the message will remain on the user's screen until the user sees the message and clicks OK.
/v
Displays information about the action to be performed.
(i.e. the output is similar to
"Send message to session Console, display time 60"
"Message sent to session Console received a user response"
etc., information indicating the operation process and results are output to output)
/w
Wait for confirmation information from the user indicating that the message has been received. If the user does not respond immediately, use the /time:seconds parameter to avoid possible prolonged delays. It is also helpful to use this parameter with /v.
message
The text of the message to be sent. If no message is typed, you will be prompted for a message or read it from standard input (STDIN). To send a message contained in a file, type a less than (<) followed by the file name.
/?
Show help in the command prompt.
MS-DOS command comments
If the user or session name is not specified, msg will display an error message. When specifying the name of the session, it must be a valid name.
Users must have permission to send messages to send messages.
MS-DOS command example
To send a message titled Let's meet at 1PM today to all sessions of user MIKES, type:
msg MIKES 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 a message to session 12, type:
msg 12 Let's meet at 1PM today
To send a message to all sessions included in the file USERLIST, type:
msg @userlist Let's meet at 1PM today
To send a message to all logged in users, type:
msg * Let's meet at 1PM today
To send messages to all users within a confirmation timeout (for example, 10 seconds) limit, type:
msg * /TIME:10 Let's meet at 1PM today