Skip to main content

How to List All Services with Automatic Startup Type in Batch Script

Auditing the startup configuration of your system is a vital part of performance tuning and security management. Services set to "Automatic" are those that launch by themselves when Windows boots, consuming memory and disk I/O before you even log in. Identifying which services are granted this privilege allows you to disable unnecessary background apps and speed up your machine's boot time.

This guide will explain how to use the wmic and sc commands to generate a clean list of all services configured with an automatic startup type.

Method 1: Using WMIC (Quick Overview)

The wmic (Windows Management Instrumentation Command-line) tool is an efficient way to list services by their configuration. It can filter the "StartMode" directly in a single command.

Basic Implementation

@echo off
echo [AUDIT] Listing all services set to start automatically...
echo ---------------------------------------------------

wmic service where "StartMode='Auto'" get Name, DisplayName, State

if %errorlevel% neq 0 (
echo.
echo [ERROR] Failed to query services.
)

echo.
pause

Explaining the Attributes:

  • StartMode='Auto': This picks only the services that are configured to start by themselves.
  • Name: The internal system name of the service.
  • DisplayName: The human-readable name seen in services.msc.
  • State: The current running state, useful for spotting auto-start services that have stopped.

Method 2: Distinguishing "Normal" vs "Delayed" Auto-Start

Windows differentiates between services that start immediately (Auto) and those that wait until the boot surge is over (Delayed-Auto). If you want to see which is which, you can enhance your query.

Script: Detailed Auto-Start Report

@echo off
echo [REPORT] Generating Detailed Startup Report...
echo.

wmic service where "StartMode='Auto'" get Name, DisplayName, DelayedAutoStart, State

if %errorlevel% neq 0 (
echo.
echo [ERROR] Failed to query services.
)

echo.
pause
info

In the output, DelayedAutoStart=TRUE means the service waits for about 2 minutes after boot. DelayedAutoStart=FALSE means it starts the moment the OS begins loading.

Method 3: The "SC" Looping Method (Pure Batch)

If wmic is unavailable on your system (as it is being deprecated in newer Windows builds), you can use a combination of sc query and sc qc inside a loop.

@echo off
setlocal enabledelayedexpansion

echo [SCAN] Scanning all services for Automatic Startup...
echo.

set "Count=0"

for /f "tokens=2" %%a in ('sc query state^= all ^| findstr /c:"SERVICE_NAME"') do (
:: For each service name, check its config for AUTO_START
sc qc "%%a" 2>nul | findstr /c:"AUTO_START" >nul
if !errorlevel! equ 0 (
echo [AUTO] %%a
set /a Count+=1
)
)

echo.
echo [DONE] Found !Count! service(s^) with Automatic startup.

pause
endlocal

Explaining the Polling Logic:

  1. sc query state= all: Gets the name of every single service on the machine.
  2. sc qc "%%a": Queries the configuration details of that specific service.
  3. findstr /c:"AUTO_START": Filters for the text that identifies automatic start.

How to Avoid Common Errors

Wrong Way: Using "sc query" alone

A common mistake is thinking sc query shows startup types.

Why it fails: sc query only shows the current running state (Running vs Stopped). A service can be set to "Manual" but still be "Running" because an app launched it. Conversely, an "Auto" service might be currently "Stopped" if it finished its work or crashed.

Correct Way: Use wmic service or sc qc.

Problem: WMIC Output Format

The output from wmic is often in Unicode (UTF-16), which can cause issues if you try to pipe it into a for /f loop inside a Batch script. Hidden carriage return characters can corrupt variable values.

Solution: When processing WMIC output in a loop, pass each value through an additional for /f to strip hidden characters, or use the PowerShell alternative:

powershell -NoProfile -Command "Get-Service | Where-Object { $_.StartType -eq 'Automatic' } | Format-Table Name, DisplayName, Status -AutoSize"

Best Practices and Rules

1. Administrative Privileges

While querying service lists is generally allowed, to see all third-party and security-protected services, you must run your Batch script as an Administrator.

2. Exporting to a File

When auditing servers, it's helpful to save this list to a text file for later comparison.

wmic service where "StartMode='Auto'" get Name, State > auto_services_list.txt

3. Identify and Disable

Once you have the list, you can proactively disable services that don't need to be automatic:

:: Example: Changing a specific unwanted service to Manual
sc config "UnwantedSvc" start= demand

Conclusions

Listing automatic services via Batch script is an essential auditing task for any performance-conscious user or system administrator. By leveraging the filtering power of wmic or the detail of sc qc, you can gain a clear understanding of what happens when your computer turns on. This visibility allows you to take control of your system resources and ensure that only the most critical services are granted the power to start automatically.