Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Net send

Status
Not open for further replies.

Terpsfan

Programmer
Dec 8, 2000
954
0
0
US
I know there was a way to send messages to users with the net send command while in visual basic. I just don't remember the code. I've looked in the microsoft knowledge base but I don't see anything on it. Thanks in advance.
 
off the top o my head Try this:

Shell(Net Send, IP Address here, Message here)
 
Shell "net send " & txtComputerName.Text & " " & txtNameMessage.Text


you need the quotes
 
Ok, the second version works in the sense that it doesn't give me an error message, but it doesn't show the message dialog. It seems to run hidden in the background.
 
Interaction.Shell "net send " & "127.0.0.1" & " " & "It Works", vbNormalFocus
 
I'm confused? Print the output to which the sender or the receiver? If it's the sender that would be easy enough, since you already know what you are sending, just execute Net Send With hidden Focus and display what you sent to the Net Send command in a text box. On the receiver's end I'm not sure how you would work it with Net Send, you would need to a way to continiously monitor net send on the receivers end not to mention the fact that Net Send's Message Box "blocks" your code, and further execution would be possible, let's do this: Tell me what you are trying to accomplish Net Send may not be the tool for you. Thanx, and let me know.
 
Correction


I'm confused? Print the output to which the sender or the receiver? If it's the sender that would be easy enough, since you already know what you are sending, just execute Net Send With hidden Focus and display what you sent to the Net Send command in a text box. On the receiver's end I'm not sure how you would work it with Net Send, you would need to a way to continiously monitor net send on the receivers end not to mention the fact that Net Send's Message Box "blocks" your code, and further execution would **not** be possible, let's do this: Tell me what you are trying to accomplish Net Send may not be the tool for you. Thanx, and let me know.
 
I got it to work this way. I created a few string variables and stuffed strEnviron with the computer name. strMessage has a generic message.

Shell ("net send " & strEnviron & " strMessage ")
 
What I want is the output that is in the dos window that is used. Like if I did a ping command on an ip address 127.1.1.1 then I would want it to output this in to a textbox or a label:

Pinging 127.1.1.1 with 32 bytes of data:

Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128
Reply from 127.0.0.1: bytes=32 time<1ms TTL=128

Ping statistics for 127.1.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

Does this make since now? I hope!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top