3

How do you find out what parameter was passed when starting a Windows service?

I usually start a service thru net start by passing parameters as shown below

net start DocumentHashService /Recursive /Count:500

services.msc does not list what parameters a service was started with. Is there a way to view the parameters passed?

3 Answers 3

2

process explorer should tell you this in the command line view. See the link for details

1
  • 1
    It is weird. For some services or applications, "Command Line" column does show parameters but not for the service I am running...
    – dance2die
    Apr 27, 2010 at 17:08
1

Normally the only reliable way is to modify the service to report or log the parameters. As this is likely not possible you can temporarily replace the service executable with one which does report the parameters. You can grab a very simple executable intended specifically for this task from here. Once you have gathered the information you require replace the executable with the original.

0

From within services.msc you can open the properties of a service and look for Path to executable: which has the entire launch string underneath, including parameters the system uses when firing it up

Here's a screenshot from the web that shows a parameter of: -sSQL2005 alt text http://www.sqlstudy.com/stimages/sql-2005-services-en.jpg

1
  • 1
    That path is read out of the registry and has nothing to do with parameters passed on with net start, which is what the question is about. Apr 28, 2010 at 1:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .