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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending Messages to other network users

Status
Not open for further replies.

TonyScarpelli

Programmer
Jan 23, 2003
361
US
I am currently using a DOS command, NET SEND, from a FoxPro 2.6 DOS application to send messages to other users on our network. We are running Windows XP SP2.

If the user isn't logged on, there is a long delay before the next message is sent, and the user sending the messages thinks that there is a lockup in the system. He's impatient. Eventually the program finishes.

Is there another way to send messages to other networked user's screens from Windows XP?

Thanks.


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
There is no other inbuilt system that you could use other than Windows Messenger.

What you could do is use something like WMI (Windows Management Interface) to see if the user is logged into the server before allowing the message to be sent.

Greg Palmer
Freeware Utilities for Windows Administrators.
 
Thanks.

I don't know much about WMI.

Can WMI be programmed by a batch file or a VB program to return values?

Thanks.


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
Yes it can

As an example open up notepad and paste the code below into it.

Code:
Dim objNet 
On Error Resume Next 

Set objNet = CreateObject("WScript.NetWork") 
If  Err.Number <> 0 Then               

MsgBox "Its OK" & vbCRLF &_ 
              "Do not press ""No"" If your browser warns you." 
Document.Location = "UserInfo.html"   
                                       'Place the Name of the document. 
                                'It will display again 
End if 

Dim strInfo 
strInfo = "User Name is     " & objNet.UserName & vbCRLF & _ 
         "Computer Name is " & objNet.ComputerName & vbCRLF & _ 
         "Domain Name is   " & objNet.UserDomain 
MsgBox strInfo 

Set objNet = Nothing

now save it as test.vbs

Double click on test.vbs and it will show you the name of the current logged on user, pc name & domain name.

I can't remember the code for searching across a server. If a google search doesn't help let me know and I'll see if I can knock something together for you.

Greg Palmer
Freeware Utilities for Windows Administrators.
 
Why not put a start before net send, then every net send is independent.
 
Thanks for the info, Greg.

To xwb,

I have a director who approves requisitions. When he finishes, my FoxPro code sends a NET SEND message to three buyers to let them know there are requisitions to process. There are 15 other people who don't need to see these messages, so I have to be able to send only to certain users. That is why I don't use the '*' which, I believe, sends the message to everyone.

One of those buyers isn't here in the morning so I don't send any messages to her before noon. However, she just happened to be here one morning last week and when she logged out at noon, there was a long wait when the director finished his approvals, and he always gets pissed at the long wait that NET SEND is causing when you try and send the message to someone not logged in. I needed a work around.

So you can see that I need some way to keep a busy boss happy.

CU


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
if you are running windows XP SP2 most likely the firewall it is active, please check it.

If this is the case any vbs pop-up messages will be deny by default….

The internal messenger it is on my opinion the best choice here.

Also since XP the net meeting it is now called "CONF" and it is no longer present in the menus, so please type CONF on the RUN… and press OK, configure it on both of the machines and enjoy messaging...


_________________________________
IBM CP, MCP 2000, E60 driver ;-)
 
also there is "chat.exe" under %windir%\system32\

old win 3.1....

_________________________________
IBM CP, MCP 2000, E60 driver ;-)
 
There is also another form of messaging that could be used, it's called email and is very handy when one needs to send messages to specific users. :).
 
yes emails are good, but it requires a email server.

they can be considered as dangerous, SPA, VIRUS, boss caught you witht he wrong...well

_________________________________
IBM CP, MCP 2000, E60 driver ;-)
 
Tony,

When xwb mentions Start he is taking about the DOS command which basically starts the process in it's own memory space.
Type Start /? at a command prompt for details.

Also just an FYI Net Send no longer exists in Vista.

Greg Palmer
Freeware Utilities for Windows Administrators.
 
Thanks for all the info.

For the record, I have been using Net Send, or it's previous Windows NT and 2000 versions, for a few years now to notify my user's about things, like to remind them there is going to be an update and they need to close my applications before they go home. This is done through a batch file.

My company's new Windows XP2 image starts with Messenger services shut off, so we had to make sure they were set on. The IS guys took care of this.

No firewall used in this instance, we are all comfy cozy in my company's network behind a strong firewall. We are a hospital and we can't let anyone in from the outside. For me to get into my computer from home I have to use a secure key fob that sets a random number every minute that's synced with the company's, and a password. Real hard to get into this place from the internet.

We have an intranet and an internet site.

Email won't work here since the buyers only look at their mail once or twice a day and they may or may not have a notification set on. We don't dictate how they set up their accounts.

Net Send is in their face right away.

So that's it.

Thanks again.

CU


Tony Scarpelli
Clinical Engineering Dept.
Maine Medical Center
Portland, Maine 04102
 
ok one thing we know: pop-up messages are not allowed.

Use wireshark (for example, find why, where are the packages being dropped.

We (you) need to know why the thing doesn't work in the first place.
Then we can move to the next level.
and second alternative (work arounds)...

_________________________________
IBM CP, MCP, (Cientist, partime)
 
Hi Tony,

Here is a solution that will work on XP machines.

Code:
On Error Resume Next
strComputer = "Laptop"
strMessage = "Hello World!!"

Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_UserAccount",,48)

For Each objItem in colItems
	
if objitem.name = "Greg" then
         	
If objitem.status = "OK" then 
	strExe = "msg.exe " & objitem.name & " " & strMessage
	Set objProcess = objWMIService.Get("Win32_Process")
	intReturn = objProcess.Create(strExe, Null, objConfig, intProcessID)
end if

end if
Next

I'm assuming that these people use the same computers and user names. If so this will work.

Using the code above change the strComputerName variable to the computer name of one of the machines.
Then change the "Greg" part of the following line to the user name of the person using that machine.

if objitem.name = "Greg" then

Now if that user is logged in when the above code is launched the user will get a message on screen. If not it will exit out of the routine.

To test it copy the above code into notepad and save as test.vbs - Obviously make the changes as above and then run it. Your user should then get a message.

If you are in a Domain you may need to specify the domain name in the user variable "MyDomain\greg" - Try without first though.

Hope this helps


Greg Palmer
Freeware Utilities for Windows Administrators.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top