Hasan,
The sc create command is not meant to be used with regular executables, but with service executables that must be written in a particular (non-portable) way.
As mentioned by Alain, you either simply use the Orthanc default installer that takes care of this or you can have a look at the Orthanc service wrapper . If you want to do it manually for some reason, I strongly advise against writing your own C++ wrapper and instead use a preexisting service wrapper such as WinSW (https://github.com/winsw/winsw) that is really easy to use.