title: Can't open the service control manager despite running command prompt as administrator
body: <p>I created a service in C# which generated an executable "GodzillaService.exe". The service itself is just a basic template generated EXACTLY according to this link, other than the name: <a href="https://www.c-sharpcorner.com/article/create-windows-services-in-c-sharp/" rel="nofollow noreferrer">https://www.c-sharpcorner.com/article/create-windows-services-in-c-sharp/</a></p>
  
  <p>The issue comes when I try to run InstallUtil. Per the article above, I execute</p>
  
  <pre><code>cd C:\Windows\Microsoft.NET\Framework\v4.0.30319 
  </code></pre>
  
  <p>on an elevated command prompt, run as administrator. I then type in</p>
  
  <pre><code>InstallUtil.exe C:\Path\To\My\EXE\Godzilla.exe
  </code></pre>
  
  <p>and I get hit with this error:</p>
  
  <blockquote>
    <p>An exception occurred during the Install phase.
    System.InvalidOperationException: Cannot open Service Control Manager
    on computer '.'. This operation might require other privileges. The
    inner exception System.ComponentModel.Win32Exception was thrown with
    the following error message: Access is denied.</p>
  </blockquote>
  
  <p>Looking at the error message, experience tells me that I need to grant access to something or someone, but what? I'm already running the program as an administrator. I've tried these things so far:</p>
  
  <ul>
  <li>Run command prompt as administrator.</li>
  <li>Run Developer Command Prompt for VS 2017 as administrator.</li>
  <li>Log out of my user account, log in to my admin account, and try running it.</li>
  <li>Move the GodzillaService.exe file into Program Files directory in case applocker is messing with it.</li>
  <li>Run VS 2017 as admin, rebuild the exe file, then try it.</li>
  <li>Try using the full path of both the exe file and InstallUtil.</li>
  <li>Made sure my admin account was in the local admin group.</li>
  <li>Tried looking at Event Viewer for more information (did not find any logs related to this issue, maybe I'm looking in the wrong place?)</li>
  <li>Tried changing the account in the service program from LocalSystem to User, LocalService, and to NetworkService</li>
  </ul>
  
  <p>I'm fresh out of ideas... Does anyone have any suggestions for what I can do to further troubleshoot this problem? I appreciate any advice given!</p>