2015년 10월 20일 화요일

Windows Msg command help and faq

(for Windows 2000, Windows XP, Windows Vista, Windows 7 and Windows 8, Windows Server 2008 and Windows Server 2012)

Since there is no net send command in Windows Vista and Windows 7 ( or even Windows 8 ), this command has been replaced by msg.exe, but not in all Windows editions - only professional and business versions are able to send network messages via msg command. In other Windows editions or as an advanced replacement, you may try our LAN messenger LanTalk NET with command line utility to send messages via command prompt.

This article is suitable for Windows 2000, Windows XP, Windows Vista and Windows 7, Professional and Business editions only.





Usage


Msg command does not require messenger service to be enabled. There is not even such a service in the system. Also, it's mostly designed for sending messages to the terminal sessions on the same server or the other server that you know. It's not very suitable for mass messaging to people on the network.



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.


Microsoft Windows networking and messaging tools

2012-05-05
CEZEO software Ltd.

댓글 없음:

댓글 쓰기