title: Getting all startup items?
body: <p>Ok, I guess I'm having a brain fart here and cant find my way out of it. What I'm trying to accomplish is to list all startup items (applications, processes, etc) and display them on a form (like what you get with msconfig.exe). I thought this code would do it:</p>
  
  <pre><code>private List&lt;StartupItems&gt; getStartupItems()
  {
      try
      {
          ManagementClass cls = new ManagementClass("Win32_StartupCommand");
          ManagementObjectCollection coll = cls.GetInstances();
          List&lt;StartupItems&gt; items = new List&lt;StartupItems&gt;();
  
          foreach (ManagementObject obj in coll)
          {
              items.Add(
                  new StartupItems
                  {
                      Command = obj["Command"].ToString(),
                      Description = obj["Description"].ToString(),
                      Name = obj["Name"].ToString(),
                      Location = obj["Location"].ToString(),
                      User = obj["User"].ToString()
                  });
          }
          return items;
      }
      catch (Exception ex)
      {
          _message = ex.ToString();
          _status = false;
          return null;
      }
  </code></pre>
  
  <p>But all that gets are the enabled ones with my username. What I'm trying to get is all items, either my username or system, all the enabled ones and all the disabled ones as well (just like msconfig). I've done tons of searching and cannot find anything really any different than what I'm using.</p>