Troubleshooting SrvAny Using Cmd.exeLast reviewed: September 23, 1997Article ID: Q152460 |
The information in this article applies to:
SUMMARYSrvAny is a tool found in the Windows NT Resource Kit that is used for running Windows NT applications as services. It may be necessary in some instances to troubleshoot an application started using the SrvAny service, and one of the best ways of doing this is by using Cmd.exe as the application starts interactively from SrvAny. From the command prompt you can then start the application in question, watch for errors, check registry values relative to the service account, and perform other troubleshooting steps. The following steps show how to set SrvAny to run an interactive command prompt for such purposes.
INSTSRV SrvAny c:\reskit\srvany.exe
A. Configure the service for automatic or manual startup type, depending on whether your troubleshooting involves an application that is started automatically through SrvAny each time the system is restarted, or only occasionally. B. Select the System account as the service (or Log On As) account and enable the Allow Service To Interact With Desktop option. This is required for the command prompt to be interactive. C. Click the OK button. (It’s fine to leave the Control Panel, Services, applet running since it is used later in these instructions.) A. Start (or switch to) the Control Panel, Services, applet. B. Select SrvAny from the list of services. C. Select the Startup Parameters text entry field. D. Enter the following text (modified to reflect your own Windows NT path):
c:\\winnt\\system32\\cmd.exe /k NOTE: Due to the way the startup parameters are parsed, the double backslashes are required to be interpreted correctly as single backslashes. E. Click the Start button to start the service. F. Perform any necessary troubleshooting steps.You do not need to continue with any of the following steps.
SrvAny as outlined in this article makes this command prompt available to all Windows NT users of the computer, and, since this command prompt is configured to run under the security context of the System account, all Windows NT users of the computer have System account access from this command prompt and any applications started from it. A. Start Registry Editor. 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. B. Select the following registry key from the window entitled "HKEY_LOCAL_MACHINE on Local Machine": HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SrvAny - With the above key selected, choose Add Key from the Edit menu. - Enter "Parameters" (without the quotes) for the key name. - Click the OK button to create this key. C. Select the Parameters key created in step 4B above. - Choose Add Value from the Edit menu. - Enter "Application" (without the quotes) for the value name and leave the data type at the default, REG_SZ. - Click the OK button to create this value. - In the String Editor window, enter the string value of "c:\winnt\system32\cmd.exe" (without the quotes), for example (your actual Windows NT path may vary). NOTE: In contrast with the format used for the startup parameters in the Control Panel, Services, applet, double backslashes are not required in the above string to be interpreted correctly by SrvAny. - Click the OK button to add this string to the Application value. D. Select the Parameters key created in step 4B above. - Choose Add Value from the Edit menu. - Enter "AppParameters" (without the quotes) for the value name and leave the data type at the default, REG_SZ. - Click the OK button to create this value. - In the String Editor window, enter the string value of "/k" (without the quotes). - Click the OK button to add this string to the AppParameters value. A. Select SrvAny from the list of services. B. Click the Start button to start the service. C. Perform any necessary troubleshooting steps. From this point on, every time you restart Windows NT, the SrvAny service starts an interactive command prompt. For more information on the SrvAny tool, see the Tool Overview Help file in the Windows NT Resource Kit and the Srvany.wri Write file.
|
Additional query words: prodnt tshoot
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |