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?

masegaloeh
  • 18,236
  • 10
  • 57
  • 106
dance2die
  • 2,011
  • 7
  • 32
  • 41

3 Answers3

2

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

Jim B
  • 24,081
  • 4
  • 36
  • 60
  • 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 '10 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.

John Gardeniers
  • 27,458
  • 12
  • 55
  • 109
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

Garrett
  • 1,638
  • 4
  • 15
  • 25
  • 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. – John Gardeniers Apr 28 '10 at 01:03