Computing.Net > Forums > Programming > VBScript for Net Send

Computing.Net: Over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to sign up now, it's free!

VBScript for Net Send

Reply to Message Icon

Original Message
Name: brian32
Date: July 15, 2005 at 12:05:43 Pacific
Subject: VBScript for Net Send
Comment:

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 = 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


Report Offensive Message For Removal


Response Number 1
Name: Michael J (by mjdamato)
Date: July 15, 2005 at 13:16:24 Pacific
Reply: (edit)

Create a variable of the computer names, THEN use the MsgBox command:

'Summary of command
For Each strName in arrPCNames
PCNamesList = PCNamesList & vbCrLf & strName
Next

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


Michael J


Report Offensive Follow Up For Removal







Post Locked

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


Go to Programming Forum Home








Do you have your own blog?

Yes
No
I did before
I will soon


View Results

Poll Finishes In 4 Days.
Discuss in The Lounge
Poll History




Data Recovery Software