1.

Solve : Sending string to multiple users...?

Answer»

I want to create a VARIABLE that is a string, like "Hello", and send to multiple users using net send. I can use net send, but cannot create a variable to be sent. I am just trying to avoid updating each net send statment when the message changes.

Does anyone have any ideas about this?

Thanks!To make sure I understand, you already have a process for sending to the multiple users, but you are trying to automate sending a particular string of text to those users? Or do you NEED to automate both parts?Here is what I am trying to do:

variable = "Good Morning"

net send AA56697 variable
net send BN45949 variable
net send YR93856 variable
etc.

This would send the message "Good Morning" to all three users listed. It currently works if I type "Good Morning" on each line, but the message is actually much longer, and I don't want to have to change each line when the message needs updating.

Thanks!You are very close already. Try this:

Code: [Select]set variable="Good Morning"

net send AA56697 %variable%
net send BN45949 %variable%
net send YR93856 %variable%Or if you want to make it a little fancier, you could try:

Code: [Select]set variable="Good Morning"
for %%a in (AA56697 BN45949 YR93856) do net send %%a %variable%Thanks, but both options give me the following error message:


Sending files is no longer supported.

More help is available by typing NET HELPMSG 3777.

Make sure the Messenger service (not to be confused with Windows Messenger) is started on the sending and receiving machines.

Start==>Run==>Services.msc

Scroll down the screen until you find Messenger and make any changes accordingly.

Hope this helps a little. 8-)Thanks, but it didn't work. Both machines have Messenger service started.

I am able to use:

net send AA43455 "Hello"

but not:

variable = "Hello"
net send %variable%

Any other ideas?Quote

variable = "Hello"
net send %variable%

I believe previous posts mentioned that you have to set the variable. Both the SET command and the NET SEND must be done in the same window.

Code: [Select]set variable = "Hello"
net send computername %variable%

GuruGary's solution still applies. 8-)Sorry, I mistyped.

I've been doing exactly that. I have these two lines in a file called send.bat:

set variable "Hello"
net send AA54546 %variable%


Can anyone reproduce this using either network Id or computer name successfully?I was able to get your send.bat file to work without any problems. Used a different computername of course.

What OS and type of network are you using?

8-)

It's highly recommended to disable the Messenger Service as this can be the source of UNWANTED popups from the script kiddies.I'm actually using my Windows (2000) network login, not computer name. I will try it with the computer name instead.

Not sure of the network type.Be sure there is an EQUALS sign (=) between the variable and Hello. The line should be exactly like this:
Code: [Select]set variable="Good Morning"
If that still does not work, then put an "echo" at the beginning of the first line so we can see the output, and then post the results. EXAMPLE, change your batch file from:
Code: [Select]@echo off
set variable="Good Morning"
net send AA56697 %variable%to
Code: [Select]@echo off
set variable="Good Morning"
echo net send AA56697 %variable%


Discussion

No Comment Found