1

Disclaimer: the error message is translated from Swedish (and it's a pain to find the exact corresponding error message in English, Microsoft take note...) The error message could also be "Path ' ' not found" or "Path not found". It's a bit unclear due to the Swedish message not enclosing the path in ' '.

This is similar to this question, but not exactly: New Windows Service installed, fails to start: "System error 2 ... system cannot find the file specified"

I have written the service myself. It is an exe written in unmanaged C++ and is using the following external code:

  • libntlm - loaded as dynamic library (libntlm-0.dll placed in same location as executable)
  • OpenSSL - loaded as static library
  • pugixml - compiled directly into code

The problem I'm having is that it doesn't start when Windows starts, but it does start if I manually start it! I am stumped as to what could be wrong. The only thing I can think of is if perhaps the dll can't be found, but I don't know why it wouldn't. Something with the environment variables being different perhaps?

What I have tried:

  • Checked registry, path is correct
  • Path is to local disk
  • Changed to a number of different paths (no change)
  • Made sure there are no spaces in the path
  • Logging at start of program (nothing written to log, so it's not an internal path not found error)
  • Dll is in same path
  • Set to start with my own network account (no change)
  • Tried renaming exe to be the same as service name (no change)
  • Tried registering libntlm-0.dll with regsrv32 but that didn't work
  • Put libntlm-0.dll in System32 (no change)
Community
  • 1
  • 1
DaedalusAlpha
  • 1,610
  • 4
  • 20
  • 33
  • Try using automatic delayed start to start the service, may be it helps.. – 51k Mar 10 '14 at 09:48
  • Is it dependent on any other services running? The automatic delayed may fix it if so, but installing the service with a dependency would be the preferred fix. – hmjd Mar 10 '14 at 10:18
  • As far as I know there are no dependencies on other services. If there are, I haven't added them by purpose and wouldn't know what they are. – DaedalusAlpha Mar 10 '14 at 10:34

1 Answers1

1

For posterity it seems like the delayed start suggested by 51k seems to work. I don't know why that should make any difference, but as long as it works I'm happy.

DaedalusAlpha
  • 1,610
  • 4
  • 20
  • 33