none
Creating a Windows Service using c#

    Question

  • Hi,

    I Created a windows Service called "TestServer" using c# code on remote system , in the code I m giving below command. I have Given Startup Type as auto. But when remote system is restarted the service is not starting until I manually I start. Can any one help me suggesting what might be the issue here.

    COmmand : sc create \\10.140.345.34 TestServer displayname= "TestServer" binpath= "\\10.140.159.78\c$\Services\Service.exe" start= auto

    Tuesday, March 14, 2017 3:23 AM

All replies

  • Better to ask development questions on MSDN, possibly over here.

    https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/home?category=windowsdesktopdev

     

     



    Regards, Dave Patrick ....
    Microsoft Certified Professional
    Microsoft MVP [Windows Server] Datacenter Management

    Disclaimer: This posting is provided "AS IS" with no warranties or guarantees, and confers no rights.

    Tuesday, March 14, 2017 4:17 AM
  • > COmmand : sc create \\10.140.345.34 TestServer displayname= "TestServer" binpath= "\\10.140.159.78\c$\Services\Service.exe" start= auto
     
    Most probably it fails to start because the service executable is on a UNC path that is not available at start time (network not initialized yet). Put the exe in a local folder... And you should start to read eventlogs :-)
     
    Tuesday, March 14, 2017 1:19 PM