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 Chriss Miller 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.

peekay

Programmer
Joined
Oct 11, 1999
Messages
324
Location
ZA
I am trying to send a message to another computer on a LAN with netsend. The command I am using is

Interaction.Shell "net send " & CompName & " " & txtMes.Text, vbNormalFocus

It does not give me an error and I cannot read the message on the other computer. What do I miss out.

Thanks PK Odendaal
and pko@942.co.za
 
I use the following:

Dim objNetSend
Dim strIPAddress
Dim strMessage

strIPAddress = "Enter IP"
strMessage = "Enter Message"

objNetSend = Shell("C:\WINNT\SYSTEM32\CMD.EXE /c net send " & strIPAddress & " " & strMessage , 0)

Give this a go and see if this works.
 
Peekay,
Are you using VB6? Your code looks like VB.Net
________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'People who live in windowed environments shouldn't cast pointers.'
 
ca8msm
Thanks I will try it

johnwm
I am on vb6 and I got this on a thread here TT somewhere.


PK Odendaal
and pko@942.co.za
 
ca8msm
According to thread 222-469766 it seems possible to use computer names in stead of IP addresses. I have the computer names available after executing the API function Wnetenumopen, but I do not know how to obtain the IP addresses.

Thanks.
PK Odendaal
and pko@942.co.za
 
It should still work using the computer name, so you dont actuall need the IP. You would simply do:

Dim objNetSend
Dim strComputerName
Dim strMessage

strComputerName = "Enter Computer Name"
strMessage = "Enter Message"

objNetSend = Shell("C:\WINNT\SYSTEM32\CMD.EXE /c net send " & strComputerName & " " & strMessage , 0)


 
Hi ca8msm
I have tried your tip but I sit with the same problem. I do not get an error message but similarly I cannot see a message on the other computer. Do I not need a form or a control on the other computer to write the message to. How does the other computer invoke a control to write the message to. PK Odendaal
and pko@942.co.za
 
The Messenger service needs to be running on the other computer. The message will pop up in a message box. Have you tried sending a message from a command prompt to see if it works at all?
 
jbradley
I am completely ignorant of messenger services. Can that be done on Windows98 and Windows2000 and how does one activate it.
Thanks
PK Odendaal
and pko@942.co.za
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top