WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Networks - Servers
plus
plus
plus
plus
plus
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Send Messages to Users


Question:

I want to be able to send messages to users logged into a windows domain. is there any way to do this?

Answer:

If you're talking about a popup using the Messenger service, try this. Change as necessary. I think I got the basics from the Tech Support DB. I believe the message is limited to something like 128 bytes.
; This will send messages to workstations running the
; "Messenger" service.  Could be updated to 6.1 dialogs.

Debug(@OFF)
;;;;;;;;;;;;;;;; Generic Initialization ;;;;;;;;;;;;;;;;;;;;

IntControl(12,5,0,0,0)

If FileExist("debugon.chk") Then Debug(@ON)
If FileExist("debugtraceon.chk") Then DebugTrace(@ON,"trace.txt")

fromperson="Dave Hartman@KRC"

:main

newx = IntControl(75,1,0,0,0)
newy = IntControl(75,2,0,0,0)

MyDialogFormat=`WWWDLGED,5.0`

MyDialogCaption=`NetSender`
MyDialogX=newx
MyDialogY=newy
MyDialogWidth=259
MyDialogHeight=93
MyDialogNumControls=12

MyDialog01=`34,16,62,DEFAULT,EDITBOX,workstation,""`
MyDialog02=`34,30,62,DEFAULT,EDITBOX,toperson,""`
MyDialog03=`34,44,62,DEFAULT,EDITBOX,fromperson,""`
MyDialog04=`34,58,218,DEFAULT,EDITBOX,thetext,""`
MyDialog05=`2,16,32,DEFAULT,STATICTEXT,DEFAULT,"Workstation:"`
MyDialog06=`24,30,10,DEFAULT,STATICTEXT,DEFAULT,"To:"`
MyDialog07=`20,44,14,DEFAULT,STATICTEXT,DEFAULT,"From:"`
MyDialog08=`2,2,76,DEFAULT,STATICTEXT,DEFAULT,"Net Send message application"`
MyDialog09=`2,76,36,DEFAULT,PUSHBUTTON,DEFAULT,"Send",1`
MyDialog10=`42,76,36,DEFAULT,PUSHBUTTON,DEFAULT,"Exit",0`
MyDialog11=`106,76,148,DEFAULT,VARYTEXT,result,""`
MyDialog12=`10,58,24,DEFAULT,STATICTEXT,DEFAULT,"Message:"`

ButtonPushed=Dialog("MyDialog")

If buttonpushed == 0 Then Goto alldone

;------------------------------------------------------------------------
:process

bb=BinaryAlloc(5000)
pointer=0
pointer=pointer+1+BinaryPokeStr(bb,pointer,fromperson)
pointer=pointer+1+BinaryPokeStr(bb,pointer,toperson)
pointer=pointer+1+BinaryPokeStr(bb,pointer,thetext)
BinaryWrite(bb,"\\%workstation%\mailslot\messngr")
BinaryFree(bb)
result = "Message sent"

Goto main

;----------------------------------------------------------
:alldone

:End
Exit

User reply:

I am sorry what i meant to say is that i was wondering if there is a comparable command for Microsoft as it is for n4MsgSend in Novell? I just need something that will send a message to a user logged onto a server.

Answer:

IntControl(72,2,0,0,0)
IntControl(1007,1,1|2,"Message","atom.ico")
While @True
   who=AskLine("To whom is this message...","Enter the computername or the username","%who%")
   text=AskLine(StrCat("And what is the message to ",StrUpper(who),"..."),"Enter the message to the user","%text%")
   RunHide ("net", StrCat("send ",who," ",text))
Endwhile
Or this version goes back to the task tray when completed.
IntControl(72,2,0,0,0)
IntControl(1007,1,1|2,"Send Message To Network User","")
While @True
   who=AskLine("To whom is this message...","Enter the computername or the username","%who%")
   text=AskLine(StrCat("And what is the message to ",StrUpper(who),"..."),"Enter the message to the user","%text%")
   RunHide ("net", StrCat("send ",who," ",text))
   IntControl(1007,3,1|2,"Send Message To Network User","")
Endwhile

Article ID:   W16036
File Created: 2004:03:30:15:42:24
Last Updated: 2004:03:30:15:42:24