title: Python WMI query for Windows services with StartMode of "Automatic (Delayed Start)"
body: <p>Anyone have a nifty trick (in Python) to detect Windows services that are configured with a Startup Type of "Automatic (Delayed Start)"?</p>
  
  <p>I thought WMI would be the way to go, but services configured as "Automatic" and "Automatic (Delayed Start)" both show up with a StartMode of "Auto".</p>
  
  <p>For example, on my local Windows 7 box using Services.msc I see that "Windows Update" is configured for "Automatic (Delayed Start)" yet WMI simply shows as "Auto":</p>
  
  <pre><code>&gt;&gt;&gt; c = wmi.WMI()
  &gt;&gt;&gt; local = c.Win32_Service(Caption='Windows Update')
  &gt;&gt;&gt; len(local)
  1
  &gt;&gt;&gt; print local[0]
  
  instance of Win32_Service
  {
          AcceptPause = FALSE;
          AcceptStop = TRUE;
          Caption = "Windows Update";
          CheckPoint = 0;
          CreationClassName = "Win32_Service";
          Description = "Enables the... &lt;cut for brevity&gt; ...(WUA) API.";
          DesktopInteract = FALSE;
          DisplayName = "Windows Update";
          ErrorControl = "Normal";
          ExitCode = 0;
          Name = "wuauserv";
          PathName = "C:\\Windows\\system32\\svchost.exe -k netsvcs";
          ProcessId = 128;
          ServiceSpecificExitCode = 0;
          ServiceType = "Share Process";
          Started = TRUE;
          StartMode = "Auto";
          StartName = "LocalSystem";
          State = "Running";
          Status = "OK";
          SystemCreationClassName = "Win32_ComputerSystem";
          SystemName = "MEMYSELFANDI";
          TagId = 0;
          WaitHint = 0;
  };
  
  &gt;&gt;&gt; local[0].StartMode
  u'Auto'
  </code></pre>
  
  <p>I welcome any suggestions.</p>
  
  <p>Cheers,
  Rob</p>