PDA

View Full Version : Using variables in net send command



dykstrad
04-27-2005, 11:03 AM
I use net send to notify *5 users of new file postings each morning. So I have a batch file that reads something like:

net send computer* The new files are out.
net send computer2 The new files are out.
net send computer* The new files are out.
ect.....

What I want to do, is to change the message every morning to something different. Presently the only way I know how to do it is to edit the bat file and cut and paste a new message into each net send line, save and run the batch file.

Is it possible to have the batch file prompt me for the message of the day (this would be my variable) and to send that message to all *5 computers?

It shouldn't matter but I am using 2000 server and XP clients.

Thanks for any input, Doug

SyntaXmasteR
04-27-2005, 11:23 AM
Doug

This would be VERY easy actually.

*st way:



Echo off
prompt ~
cls

Echo.
Echo.
Echo.
Echo.
Echo ENTER MESSAGE OF THE DAY
Echo.
Echo.
Echo.
Echo.

set /p message=

net send %computername% "%message%"
net send %computername% "%message%"

exit

Unregistered
04-28-2005, 05:17 PM
Thanks for the quick response and the advise. I have been playing with what you gave me and have picked up a lot already. I noticed that you option * are there more variations that I could do? I'm willing to learn more.

Thanks, Doug