stoplaw service fails to stop

Symptom Solution

The following error may occur when running the stoplaw command

Failed to stop service. Error code 1053

To resolve this issue, adjust the default time-out period for Windows services.

  1. In the Registry Editor (regedit), right-click the following registry subkey

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control

  2. 32-bit Windows Select New>DWORD Value.

    -or-

    64-bit Windows Select New>QWord Value

    In the right pane of Registry Editor, New Value #1 (the name of a new registry entry) is now selected for editing.

  3. Type ServicesPipeTimeout to replace New Value #. Press Enter.

  4. Right-click on ServicesPipeTimeout registry and then click Modify.

  5. In the Value data textbox, type the desired timout period for the service in milliseconds and click OK.

    Example

    if you want to set the time-out period to 120 seconds (120000 milliseconds or 2 minutes), type 120000.

  6. Reboot the machine. You must restart the computer for Service Control Manager to apply this change.