title: Delphi Windows Services command line arguments
body: <p>I have a Deplhi based Windows Service that, on installation, parses some command line arguments. I want those arguments to be added to the services command line (ImagePath value on the registry) so that the service is always started with them.</p>
  
  <p>How can I accomplish this?</p>
  
  <p>I want the regedit look like this:<br>
  at registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MyService  </p>
  
  <ul>
  <li><code>ImagePath = C:\Path\to\my\service.exe <strong>-some -arguments</strong></code></li>
  </ul>
  
  <p>Thanks</p>
  
  <p>Update: The installation is done with <code>&gt;MyService.exe /install -some -arguments</code>. Those arguments are the ones I want to persist in the command line.</p>
  
  <p>Update: I found a solution by writing directly to the registry (see <a href="https://stackoverflow.com/questions/393742/delphi-windows-services-command-line-arguments#394493">here</a>), but I'd still like a more elegant solution, like using some TService property or something of that sort. Thanks!</p>