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

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

VBScript for Net Send

Reply to Message Icon

Name: brian32
Date: July 15, 2005 at 12:05:43 Pacific
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



Sponsored Link
Ads by Google

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

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


0
Reply to Message Icon

Related Posts

See More







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


Sponsored links

Ads by Google


Results for: VBScript for Net Send

VBScript for NET SEND command www.computing.net/answers/programming/vbscript-for-net-send-command/13032.html

ip tracer for net send? www.computing.net/answers/programming/ip-tracer-for-net-send/8513.html

Net Send www.computing.net/answers/programming/net-send/8378.html