HOWTO: Run Automation Manager as a Windows NT Service

Last reviewed: August 13, 1997
Article ID: Q143431
The information in this article applies to:
  • Standard, Professional, and Enterprise Editions of Microsoft Visual Basic, 16-bit and 32-bit, for Windows, version 4.0

SUMMARY

The Windows NT Resource Kit provides two utilities that allow you to create a Windows NT user-defined service for an application (executable) or batch file. This article describes how to use these two utilities, SRVANY.EXE and INSTSRV.EXE, to set up the Automation Manager as a Windows NT service. In this article you will be instructed to use the Registry Editor, REGEDT32.EXE. Before doing so, please read the following:

WARNING: Using Registry Editor incorrectly can cause serious, system-wide problems that may require you to reinstall Windows NT to correct them. Microsoft cannot guarantee that any problems resulting from the use of Registry Editor can be solved. Use this tool at your own risk.

MORE INFORMATION

When using the Registry Editor, you will be instructed to add a key or add a value to the Registry. To add a key, select Edit from the Registry Editor menu and choose Add Key. Similarly, to add a value, select Edit and then choose Add Value. Making any of the above selections will result in a prompt for further data. Please follow the steps below for the correct setting.

To set Automation Manager as a Windows NT service, do the following step-by-step instructions:

  1. Copy SRVANY.EXE and INSTSRV.EXE to your system32 directory.

  2. Select a name for your service, AutoMan for instance, and install it as a new service by typing the following at the command line:

          INSTSRV AutoMan C:\windows\system32\SRVANY.EXE
    

  3. If new service is created successfully, you should get the following:

    CreateService SUCCESS Don't forget!!! You must now go to the Control Panel and use the Services utility to change the account name and password that this newly installed service will use when it attempts to logon as a service when it starts. Also, use the Services utility to ensure this newly installed service starts automatically, since the point of this service is to start automatically and apply the DACLs to the floppy drives prior to a user logging on at the keyboard

  4. Now go to the Control Panel and open the Services utility.

  5. Select your new service, in this case AutoMan, and click the Startup button.

  6. If you want your service to start every time you boot your machine, select Automatic for Startup Type in the Service dialog box. Otherwise select Manual or Disabled. If you select Manual, you will need to go into the Services utility, select the service, and click the Start or Stop button every time you want to start or stop the service.

  7. Select System Account for Log On As, and make sure to check the Allow Service to Interact with Desktop option.

  8. Click OK and Close the Services utility.

  9. Run REGEDT32.

  10. Under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\AutoMan, add a new key and set its name to "Parameters" (without quotes). Notice that AutoMan is only the service name in this case. You may have chosen a different name.

  11. Under Parameters, add a new value. Set Value Name to "Application" and leave the default REG_SZ for Data Type. When prompted for the value's string, set it to reflect the path and filename of the Automation Manager, for example C:\windows\system32\AUTMGR32.EXE.

  12. If you intend to run the Automation Manager invisible, add another value under the Parameters key and set its name to "AppParameters". Leave the default REG_SZ for Data Type, and set the String to "/hidden".

  13. Now Exit RegEdt32 and restart your machine. If you selected Automatic for Startup Type in step 6, the Automation Manager should start automatically. Otherwise, open the Services utility from the Control Panel and start the service manually. If you chose to run Automation Manager hidden, you can verify that it is running by using PView.

REFERENCES

   ARTICLE-ID: Q137890
   TITLE     : How To Create a User-Defined Service

   ARTICLE-ID: Q138067
   TITLE     : How To Hide the Automation Manager
Keywords          : PrgOther VB4ALL VB4WIN kbhowto
Version           : 4.0
Platform          : NT WINDOWS


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: August 13, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.