I'm really new to scripting with batch files, and I'm working on a program for a messaging system on our terminal server network. I had three issues to overcome. The first was how to send a single message using the msg command to a group of users, How to send a message to all users, and the last one I can't solve, which is sending to 2 or 10 users by typing in their login names. I'm mostly using the msg command to create this system, but I can't figure out or find a way to use the msg command to do this. It only seems to be capable of sending to a @list.txt of users, a single user, or all users.
This is an example of what I'm trying to do in my script, but I can only send to one user. I need to figure out a way to send to 2 - 15 users by typing in their login account names. All of the account names are a 4 digit number, 1901, 1902, 1903, etc.
set /p a=User:
set /p b=Message:
msg %a% /Server:ts1 %b%
On the user I need to be able to do multiples.
I would be so thankful for any help.