srvany.exe - Microsoft utility to run dmh_wish.exe as a service


The srvany.exe utility is distributed by Microsoft as part of their Resource Kit for Windows NT. Included with this utility is a Word document, srvany.doc, and two utilities, Instsrv.exe, and Srvinstw.exe that are used to install services. A service is similar to a background process on Unix.

The implications of running as a service include:

You can install your own Tcl/Tk application to run as a service. One idea is to start a DMH server running that other applications can connect to and use to start other processes. This is similar to an rexec demon. You may find this example useful to start database interfaces on remote machines. The command message that you send to start the database interface can specify a DMH message group for the database interface to connect to.

Here are the steps to configure a DMH startup service:

  1. Copy the srvany.exe program to a suitable directory on your system such as c:\usr\local\bin.

  2. Install the srvany.exe program as a service using the Instsrv.exe utility from the Microsoft resource kit.
      instsrv srvany c:\usr\local\bin\srvany.exe
  3. Now you specify parameters to the srvany service so it knows what application to start and it knows what command line arguments to provide to the application. You can specify the parameters by using REGEDT32.EXE following the directions in srvany.doc or you can copy the following information to a file such as "srvany.reg", edit it for your circumstances, and double-click on it from the Windows Explorer. The file must end in the suffix ".reg" which Windows recognizes.
    "AppParameters"="-f dmh85_server startup \"after 1 {mbx whenmsg startup_RPC mbx_RPC}\""
  4. You can configure selected aspects of the service using the Control Panel/Services applet. The default installation creates a service that will automatically start with the next reboot. You can use the Control Panel to manually start now.

  5. You can show that the dmh_wish.exe process is running in several ways.

    1. Right click on the Start bar and invoke the Task Manager.... You should be able to see the dmh_wish.exe process running.

    2. Use inspect, on the Target page, specify the DMH mailbox target as "startup_RPC@startup". If you are on a different computer, use "startup_RPC@hostname:startup" where hostname is the hostname of the NT machine. You will be inspecting the service process.

With the service running, you can connect to it from another computer and remotely start applications. If you do not include the ampersand & background character on an exec command, the startup server will not respond to any more messages until the exec'd process finishes. Usually you want to be sure to specify the ampersand.

For an example, we will startup a datahub, and then startup a database interface on the remote NT machine which will connect to the datahub. Suppose that the NT machine's hostname is office:


Windows NT, service, background, daemon