Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've created a user interface in VBScript that compliments the NET SEND command in Windows XP. It allows the user to input any number of computer names seperated by a comma (,), then input the message that they want to send. Finally, It displays a summary of what message was sent and the computer names.
This thing is that I'd like for it to display all the computer names on the same message box. The way I have it now, it displays each PC in it's own popup box.
How can I modify my script to display a list of all the PCs that got the message using the msgbox function?
Dim arrPCnames()
intSize = 0Set 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 & " " & Message2SendReDim Preserve arrPCnames(intSize)
arrPCnames(intSize) = PC2Reach
intSize = intSize + 1Next
'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

Create a variable of the computer names, THEN use the MsgBox command:
'Summary of command
For Each strName in arrPCNames
PCNamesList = PCNamesList & vbCrLf & strName
NextMsgBox "Here's you message:" & vbCrLf & _
vbCrLf & _
Message2Send & vbCrLf & _
vbCrLf & _
"Computers that got the message:" & vbCrLf & _
PCNamesList
Michael J

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |