none
using sc.exe for a .NET application RRS feed

  • Question

  • Hi,

    I saw an article about the sc.exe and I would like to ask can I use it to make my WinForm application to run as a service?

    Thanks,

    Jassim

    Sunday, August 24, 2014 6:13 AM

Answers

  • Hello Jassim,

    I am not sure whether this tool would work with a windows application, because as far as I know, a windows service should have a base class named ServiceBase while a windows form does not inherent from this class.

    However, from this article regarding SC.exe, it describes that the binpath accepts an executable file path, you could try with below syntax:

    sc create YourSerice binpath="D:\BMX\Project\2014\08\NETFrameworks\P20140825\bin\Debug\P20140825.exe" displayname= "YourServiceName" depend= Tcpip start= auto

    Replacing the binpath with yours which points to the windows application.

    Best Regards,

    Fred.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, August 25, 2014 4:49 AM
    Moderator