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.

How to Display a Message on a Remote Workstation and Run Winbatch as a Service

Keywords:     display remote display	service srvany

Question:

How would I display a banner or message box on a remote workstation? And is there a way to send a network message from a Winbatch script, running on a server, to an NT group of users ?

Answer:

A mailslot is a mechanism for one-way interprocess communications (IPC). A Win32-based application can store messages in a mailslot. The owner of the mailslot can retrieve messages that are stored there. These messages are typically sent over a network to either a specified computer or to all computers in a specified domain. A domain is a group of workstations and servers that share a group name.....

For more info see the following tech article: W13764


I have seen schemes where all the workstations are running WinBatch scripts with a loop and a TimeDelay monitoring some server file every few seconds, and if the file comes into existance, then pop up a message.

You'd either have to have the WinBatch interpreter installed on the remote PC(s), or have a compiled WinBatch EXE on the machine(s).

Either the WBT or EXE on the remote machine would have to be running all the time in a While loop.

The WinBatch script on the LOCAL machine would copy a file to the remote machine, when you're ready to display the message on the REMOTE workstation.

The WinBatch script on the REMOTE machine would be looking for a file to appear in this continuous While loop, and once it shows up, it could put up a message box with the Message function, or you could use the Boxes functions to display a banner.

When you've finished doing what you need to do, then you can delete the flag file on the remote machine. Something like:

;local Winbatch script - first map to remote PC, then copy the file:
	AddExtender("WWW9534I.DLL")
	w95AddDrive(@default,@default,"\\SERVER\PUB","x:",@false)
	  FileCopy("c:\localdir\flagfile.txt", "x:\flagfile.txt",  @false)
	w95CancelCon("x:",@false,@false)
	      
And now for the remote script:
	
   while @true		;run all the time
      if FileExist("flagfile.txt")==1 then Message("USER ALERT", "DON'T TOUCH THE KEYBOARD")
      FileDelete("flagfile.txt")
      TimeDelay(10)
   endwhile


Here's another user's implementation of this concept, running Winbatch as a service:

To get localgroup info out of Nt on a 9x box, write a separate winbatch script which does this (and only this) for NT, and run this as a service on the NT server. Then, on your 9x boxes, they can post a message to this remote service (eg by writing out a file), which the service reads, and posts back the answer to the question. I've done this now for a number of the NT commands that are not normally avaliable for 9x, and it seems to work fine.

The service script is looping until it finds a specific file name in a specific directory, at which point it writes a file with the current LocalGroup info, which the w9x then reads. It might be a good idea to add a TimeDelay(2) or something in the service script loop so it only checkes once every 2 seconds or so.

You'd be surprised how little load it actually places on the server. Writing it as a service is easy. Just check out intcontrol, and use Microsoft's srvany.exe to install the service.


And input from someone else:

If winbatch is on the remote pc, you could setup a winsock connection.

I've got a pc that can send pages (restricted IP) but jobs that run on other pcs. When done, the JOB-PC connects to the listener and sends an "all-done" message. The listener PC then pages me with the results.

See the Internet Extender for winbatch, particularly the Listener and Connector scripts.

Done right, the listener can run all day without any problems.


Article ID:   W13479
Filename:   Display a Banner or Message Box on Remote PC.txt
File Created: 2017:08:29:11:51:02
Last Updated: 2017:08:29:11:51:02