views:

291

answers:

3

I'm trying to register an atl service using

ExeName.exe /service

as described here: http://msdn.microsoft.com/en-us/library/74y2334x(VS.80).aspx

After doing so though, it's not appearing in my services control panel (the one that I get to by typing Services in the start box on vista).

I've tried to dig through the atl code to see where it handles the /service switch, but can't find it, although I can find code to handle /RegServer and /UnregServer

This used to work, I've somehow managed to register this service before. But, now I've moved its location and can't get it registered again. When I run ExeName.exe /service, it does start up as a Local Server if I do a /RegServer first, but I want it installed as a service.

Am I missing something, and do you know where the handling of the /service switch is done?

+1  A: 

Shot in the dark: Are you running on Vista? If so make sure you are running with full admin privleges. Otherwise it's possible you're registering this app via virtualization.

JaredPar
Good suggestion, I've just double checked my privileges, and I think I've got all the appropriate admin rights.
Scott Langham
Ah well, worth a shot
JaredPar
A: 

Check that you haven't accidentally typed some characters in the name of the function ParseCommandLine in class CAtlServiceModuleT defined in atlbase.h

If you do so, there's a version of this function also in the base class which will mean eveything will compile nicely, and it could take you all day to spot this daft mistake!

;-)

Scott Langham
A: 

Same as JaredPar did, try command with Power Shell with full admin privileges.

lsalamon