How to push out a domain message through vbscript??

Posted on 2009-02-12
Last Modified: 2012-05-06
i am very familiar with net send and i was wondering if anyone knows how i can make the net send with input boxes??

for example i want to have to input boxes in the script that the user will enter in the username or computer name and then type in the message they want to send and then click ok and it sends the message out.  basically make a gui for net send.

would it be simple input boxes in the script??
Question by:amoos
    LVL 47

    Accepted Solution

    This should be what you are asking for :-)

    strComputer = InputBox("Enter Machine Name")
    strMessage = InputBox("Enter Message Text")

    Set WSHShell = WScript.CreateObject("WScript.Shell")

    strCommand = "Net Send" & Chr(32) & strComputer & Chr(32) & strMessage
    objShell.Run StrCommand


    Author Comment

    modified it a little and this seems to work fine but i would like to have a from input box to.  do you think that is possible??

    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


    '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
    LVL 47

    Expert Comment

    Net send messages will always display the "from" by default, send to yourself for example
    LVL 47

    Expert Comment

    just a FYI :

    The messenger service needs to be running on remote systems for net send to work

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    In this article we want to have a look at the directory attributes which are used by Microsoft to store the so called Security Identifiers (SID). These SIDs plays an important role in delegating and granting permissions and in authentication of trus…
    Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now