4

I am creating a program that among other things is going to control Services. I am attempting to list the Services similar to the way they are listed in msconfig (the first window below).

I found where the services are listed in the registry. In Vista and Win7 the DisplayName and Description are often references. For example @%SystemRoot%\system32\aelupsvc.dll,-1 is the DisplayName data for the Service Application Experience. In Win7 there is a location where these references are stored making it easy to get the correct DisplayName. But in Vista I did not find a place in the Registry where this information is stored. So I looked at the file being referenced and found that the File Description on the Details tab of the files properties would be sufficient.

enter image description here

So how can I get the File Description? I am using Java, so I prefer using Java or the Command Line top get this information.

Dorothy
  • 2,842
  • 10
  • 33
  • 46
  • It's stored in the version resource. You can do it through the Win32 API but I'd guess that someone somewhere has a Java API that exposes htis. – David Heffernan Nov 08 '11 at 15:33

2 Answers2

2

Good job and good luck but I'd suggest you other, probably easier solution.

Use command line utility sc and/or WMI. You can connect to WMI by executing script (JScript or VBScript) using cscript utility directly from java program or using number of interoporability tools like JaWin, Jintegra or Jinterop.

JaWin and Jinterop are open source products.

AlexR
  • 114,158
  • 16
  • 130
  • 208
  • I would prefer to use something like WMI but I don't know what command will get me what I want. I tried `wmic datafile where name='C:\\Windows\\system32\\aelupsvc.dll'` but that does not have the File Description. – Dorothy Nov 08 '11 at 16:16
1

The version number is on the same page as the description.

so I guess this thread could be helpful:

Get Version Info for .exe

Community
  • 1
  • 1
juergen d
  • 201,996
  • 37
  • 293
  • 362
  • I was able to modify the code in the accepted answer to the thread you linked to, to get the information I wanted. Thanks! – Dorothy Nov 09 '11 at 15:20
  • @Dorothy I know this post is a bit old, but could you please tell how you did this (adapt VS_FIXEDFILEINFO)? Thank you very much! – casaout Sep 10 '12 at 08:31