Window Service error 2: The system cannot find the file specified, Service File in located in System32 directory


  • I wrote a window service and a window service install program using VS 2010 on a Windows 7 operating system. I place the service exe in the windows\system32 directory and indicated to the install program that is where the service is located.  When I tried to start the service an error 2 is displayed stating "The system cannot find the file specified". I right clicked on the service and checked it properties and the properties state the service is in the windows\system32 directory.

    If the  service properties state the service executable file is in the windows\system32 directory, and when I  look in the windows\system32 directory the service is there , How come when I start the service the a dialog box is displayed saying the system can not find the specified file?

    If I place the service in a user created registry and indicate to the install program to use the user created directory then the service does start.

    You can contact me at  directly if you have an answer.


    steven frierdich
    Friday, June 17, 2011 6:06 PM

All replies

  • Here's a guess - service paths must be quoted. If you haven't installed the service and given a full quoted path to the exe then it won't work.  At one time you could use an un-quoted path, but not any more.
    Phil Wilson
    Friday, June 17, 2011 8:12 PM