title: Why can't I register my COM DLLs?
body: <p>My application needs two COM DLLs to be registered. It is done automatically if the user has the necessary access rights, but otherwise it can be done using <code>regsvr32</code>.</p>
  
  <p>Now on a few workstations the following happens:</p>
  
  <ol>
  <li>Start <code>cmd.exe</code> as Administrator</li>
  <li>Register first DLL: Success </li>
  <li>Register second DLL: Failure (0x80004005, Access denied)</li>
  </ol>
  
  <p>The first time this error was reported to me, I automatically responded: "Of course it doesn't work, you need Administrator privileges." Needless to say, I felt pretty embarrassed as I tried to register the DLL myself...</p>
  
  <p><strong>What could be the reason for this: One DLL can be registered, the other not.</strong></p>
  
  <p>Some background information:</p>
  
  <ul>
  <li>Both DLLs are created with Delphi 2005.</li>
  <li>Both DLLs have very simple interfaces and only very few classes.</li>
  <li>The failing machines were always Vista or Windows 7.</li>
  </ul>
  
  <p>Normally I'd start Process Monitor, but I don't have access to one of the workstations right now, so I have to gather as much information as possible until I can get my hands on one of them.</p>
  
  <p><strong>UPDATE</strong>: I remotely accessed one of the failing workstations. Mysterious things happened:</p>
  
  <ul>
  <li>Starting Process Monitor was not possible (!) After a few seconds Windows showed a "not enough memory" error.</li>
  <li>Switching to a different user made it possible to register the DLL. (!)</li>
  </ul>
  
  <p>In other words:</p>
  
  <ul>
  <li>Log on as <code>UserA</code>, start <code>cmd.exe</code> as Administrator, <code>regsvr32.exe</code>: Failure</li>
  <li>Log on as <code>UserB</code>, start <code>cmd.exe</code> as Administrator, <code>regsvr32.exe</code>: Success</li>
  </ul>
  
  <p>What could introduce such behaviour?!</p>