Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 104147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:14:09+00:00 2026-05-11T01:14:09+00:00

I have a Deplhi based Windows Service that, on installation, parses some command line

  • 0

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.

How can I accomplish this?

I want the regedit look like this:
at registry key HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\MyService

  • ImagePath = C:\Path\to\my\service.exe -some -arguments

Thanks

Update: The installation is done with >MyService.exe /install -some -arguments. Those arguments are the ones I want to persist in the command line.

Update: I found a solution by writing directly to the registry (see here), but I’d still like a more elegant solution, like using some TService property or something of that sort. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:14:09+00:00Added an answer on May 11, 2026 at 1:14 am

    Ok, after some research, I gave up on an elegant approach, and took the straight-forward path of writing directly to the registry.

    To make things simple, I did this: I store the arguments I wanted to pass in variables on my TService. Then, I set the AfterInstall event to write directly into the registry (using a TRegistry object) the exact command line I wanted.

    uses Registry; procedure MyService.AfterInstall(Sender: TObject) ; var   reg:TRegistry; begin   reg := TRegistry.Create;   try     reg.RootKey := 'HKEY_LOCAL_MACHINE';     if reg.OpenKey('SYSTEM\CurrentControlSet\Services\MyService', True) then     begin       reg.WriteExtendString ('ImagePath', ParamStr(0) + ' -some -arguments') ;       reg.CloseKey;     end;   finally     reg.Free;   end; end; 

    Not the elegant solution I was looking for, but it does the job.

    Thanks for the other answers through!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 62k
  • Answers 62k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer While you can solve this with habtm, what you're talking… May 11, 2026 at 9:57 am
  • added an answer If you don't want to use a List, ArrayList, or… May 11, 2026 at 9:57 am
  • added an answer The lifecycle of an Applet (or JApplet) is more complicated… May 11, 2026 at 9:57 am

Related Questions

I have a Deplhi based Windows Service that, on installation, parses some command line
I have a Delphi 7 application that has two views of a document (e.g.
I have a Delphi DLL with a function defined as: function SubmitJobStringList(joblist: tStringList; var
I have a Delphi Web Server setup and running, publishing Web Services, and I
I have a delphi (Win32) web application that can run either as a CGI
I have a Delphi 5 executable that calls into a .NET assembly via the
I have a Delphi application similar to Taskbar Shuffle that includes a hook dll.
I have a query in Delphi using DBExpress TSQLQuery that looks like so ActiveSQL.sql.add('SELECT
I am responsible for a Delphi/Win32 project management application. I have just completed a
I have a server process built in Delphi/C++Builder with RemObjects SDK which claims to

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.