Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement