How to push out a domain message through vbscript??

i am very familiar with net send and i was wondering if anyone knows how i can make the net send with input boxes??

for example i want to have to input boxes in the script that the user will enter in the username or computer name and then type in the message they want to send and then click ok and it sends the message out.  basically make a gui for net send.

would it be simple input boxes in the script??
amoosAsked:
Who is Participating?
 
DonNetwork AdministratorCommented:
This should be what you are asking for :-)


http://www.myitforum.com/articles/11/view.asp?id=12448


strComputer = InputBox("Enter Machine Name")
strMessage = InputBox("Enter Message Text")

Set WSHShell = WScript.CreateObject("WScript.Shell")

strCommand = "Net Send" & Chr(32) & strComputer & Chr(32) & strMessage
objShell.Run StrCommand

0
 
amoosAuthor Commented:
modified it a little and this seems to work fine but i would like to have a from input box to.  do you think that is possible??

Dim arrPCnames()
intSize = 0

Set objShell = Wscript.CreateObject("WScript.Shell")

'Get computer names
PC2Reach = InputBox("Please enter the computer name. For additional computers, separate each with a comma")

'Get message
Message2Send = InputBox("Type your message.", "Send a message")

arrStations = Split(PC2Reach, ",")

'Send message
For Each PC2Reach In arrStations
objShell.Run "net send " & PC2Reach & " " & Message2Send

ReDim Preserve arrPCnames(intSize)
arrPCnames(intSize) = PC2Reach
intSize = intSize + 1

Next

'Summary of command
MsgBox "Here's you message:" & vbCrLf & _
vbCrLf & _
Message2Send & vbCrLf & _
vbCrLf & _
"Computers that got the message:"

For Each strName in arrPCNames
Wscript.Echo strName
Next
0
 
DonNetwork AdministratorCommented:
Net send messages will always display the "from" by default, send to yourself for example
0
 
DonNetwork AdministratorCommented:
just a FYI :

The messenger service needs to be running on remote systems for net send to work
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.