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:
instsrv srvany c:\usr\local\bin\srvany.exe
REGEDIT4 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\srvany\Parameters] "Application"="c:\\usr\\local\\bin\\dmh_wish.exe" "AppParameters"="-f dmh85_server startup \"after 1 {mbx whenmsg startup_RPC mbx_RPC}\"" "AppDirectory"="c:\\usr\\local\\bin"
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:
dmh_wish % exec datahub "set group=mbx" eof & 17329 {//c 0 SET: Variable "server" set to "DATAHUB".} {//c 0 SET: Variable "group" set to "mbx".} {//c 0 EOF: Message system initialized, command mailbox is "DATAHUB@mbx"} % mbx init office:startup office:5788 % mbx whenmsg REPLYBOX {puts $mbxmsg ; mbx whenmsg again} % mbx putr startup_RPC REPLYBOX [list exec dmh85_SQLsrv "set group=[dp_hostname]:mbx" \ "set server=ENGDB" "connect Spc2 DBA SQL" &] 0 156 % mbx end % exit