Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim arrPCnames()
  2. intSize = 0
  3.  
  4. Set objShell = Wscript.CreateObject("WScript.Shell")
  5.  
  6. 'Get computer names
  7. PC2Reach = InputBox("Please enter the computer name. For additional computers, separate each with a comma (,)")
  8.  
  9. 'Get message
  10. Message2Send = InputBox("Type your message.", "Send a message")
  11.  
  12. arrStations = Split(PC2Reach, ",")
  13.  
  14. 'Send message
  15. For Each PC2Reach In arrStations
  16. objShell.Run "net send " & PC2Reach & " " & Message2Send
  17.  
  18. ReDim Preserve arrPCnames(intSize)
  19. arrPCnames(intSize) = PC2Reach
  20. intSize = intSize + 1
  21.  
  22. Next
  23.  
  24. 'Summary of command
  25. MsgBox "Here's you message:" & vbCrLf & _
  26. vbCrLf & _
  27. Message2Send & vbCrLf & _
  28. vbCrLf & _
  29. "Computers that got the message:"
  30.  
  31. For Each strName in arrPCNames
  32. Wscript.Echo strName
  33. Next
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement