TechBuzzPro

Configure Service Dependencies in Windows Service Manager

· 6 min read · Windows & PC

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

You configure service dependencies in Windows by editing the service's registry entry or using the Services console's recovery options, but the Services console itself does not provide a direct GUI for adding or removing dependencies. The most reliable way is to use the registry editor to modify the DependOnService value under the service's key, or to use the sc config command with the depend= parameter. This ensures that when a service starts, Windows first starts the services it depends on, preventing failures due to missing prerequisites.

What You'll Need

  • Administrative privileges on the Windows PC.
  • Knowledge of the exact service names (not display names) involved. You can find these in the Services console under the "Name" column or via sc query.
  • Registry Editor (regedit) or Command Prompt with administrator rights.
  • Backup of the registry or a system restore point before making changes (recommended).

Step-by-Step

  1. Open the Services console by pressing Win + R, typing services.msc, and pressing Enter. This lists all services and their status.
  2. Identify the service you want to configure and note its exact service name (not the display name). You can right-click the service, choose Properties, and look at the "Service name" field at the top of the General tab.
  3. Open Registry Editor by pressing Win + R, typing regedit, and pressing Enter. Accept the UAC prompt.
  4. Navigate to the service's registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<ServiceName>, where <ServiceName> is the exact name you noted.
  5. Locate or create the DependOnService value: In the right pane, look for a multi-string value named DependOnService. If it doesn't exist, right-click in the right pane, choose New > Multi-String Value, and name it DependOnService.
  6. Edit the value: Double-click DependOnService. In the Value data box, enter the service names of the dependencies, each on a new line. For example, if your service depends on "Workstation" and "TCP/IP NetBIOS Helper", you would enter LanmanWorkstation and lmhosts (use exact service names). Click OK.
  7. Verify the change: Close Registry Editor, then in the Services console, right-click your service and choose Properties. On the Dependencies tab, you should now see the added services listed under "This service depends on the following system components".
  8. Restart the service (or the computer) to apply the changes. If the service is running, stop it first, then start it again. Windows will attempt to start the dependencies automatically.

Note: Menu labels and paths can differ slightly between Windows versions (Windows 10, Windows 11, Server editions). The registry method works across all modern Windows versions. Alternatively, you can use the command line: open Command Prompt as administrator and run sc config <ServiceName> depend= <Dependency1>/<Dependency2> (use a forward slash to separate multiple dependencies, no spaces). For example: sc config MyService depend= LanmanWorkstation/lmhosts. This achieves the same result without editing the registry directly.

Common Mistakes

  • Using display names instead of service names: The registry and sc command require the internal service name (e.g., LanmanWorkstation), not the display name (e.g., "Workstation"). Using the wrong name will cause the dependency to be ignored or cause errors.
  • Creating circular dependencies: If Service A depends on Service B and Service B depends on Service A, neither will start. Always ensure dependencies form a one-way chain.
  • Forgetting to separate multiple dependencies correctly: In the registry, each dependency goes on a new line. In the sc command, separate them with a forward slash (/), not a comma or space.
  • Not testing after changes: Always restart the service or reboot to confirm the dependency works. A misconfigured dependency can prevent the service from starting, which might affect other system functions.
  • Editing the wrong registry key: Ensure you are under CurrentControlSet and not ControlSet001 or similar, unless you know what you are doing. Changes to non-current control sets may not take effect immediately.

Tips

  • Before making changes, export the service's registry key (right-click the key, choose Export) as a backup. If something goes wrong, you can restore it by double-clicking the .reg file.
  • Use the sc qc <ServiceName> command to view a service's current dependencies without opening the registry.
  • If you need to remove a dependency, simply delete the corresponding line in the DependOnService value, or set it to empty. If no dependencies remain, you can delete the value entirely.
  • Test dependency changes during a maintenance window, as restarting a service can interrupt dependent applications.
  • For services that are part of a suite (e.g., SQL Server), check the vendor's documentation for recommended dependencies to avoid conflicts.

Troubleshooting

If the service fails to start after adding dependencies, check the following:

  • Event Viewer: Open Event Viewer (eventvwr.msc) and look under Windows Logs > System for errors related to the service. Error codes like 1068 (dependency failed to start) or 1075 (dependency does not exist) can point to the issue.
  • Verify service names: Double-check that the dependency service names are spelled correctly and exist on the system. Use sc query <name> to confirm.
  • Check dependency status: Ensure the dependency services themselves are not disabled or set to manual when they need to be automatic. If a dependency is stopped and set to manual, Windows may not start it automatically when your service starts.
  • Remove recent changes: If the service was working before, revert the DependOnService value to its previous state (use your backup) and restart the service.
  • Use sc config to reset: If the registry edit caused issues, you can reset dependencies using sc config <ServiceName> depend= (with a space after the equals sign to clear dependencies).

If the problem persists, consider using the System Configuration utility (msconfig) to perform a clean boot, which can help identify if a third-party service is interfering.

Frequently Asked Questions

Can I add dependencies using only the Services console?

No, the Services console (services.msc) only displays dependencies on the Dependencies tab; it does not allow adding or removing them. You must use the registry or the sc command.

What happens if a dependency service is not installed?

Windows will fail to start your service and log an error (e.g., error 1075). Ensure all dependencies are installed and their service names are correct.

Do I need to restart the computer after changing dependencies?

Not always. Restarting the service is often enough, but some dependencies may require a reboot to take effect. If the service doesn't start, try rebooting.

How do I find the service name for a dependency?

In the Services console, right-click the service and choose Properties; the "Service name" field shows the internal name. Alternatively, use sc query or Get-Service in PowerShell.

Can I set dependencies for a service that is already running?

Yes, but the changes won't affect the currently running instance. You must restart the service for the new dependencies to be enforced.

Is it safe to edit the registry?

Editing the registry carries risk; always back up the key first. Incorrect changes can prevent services from starting, so proceed carefully and test in a non-production environment if possible.