Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Registering an exe as a service.

Registering an exe as a service.

Scheduled Pinned Locked Moved Visual Basic
helptutorial
10 Posts 3 Posters 12 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    draghu
    wrote on last edited by
    #1

    Hi all, Can somebody help me/point me on how to register an exe as a service. I googled for it but it lead to confusion more than any help. My exe would require a command line argument to start. So I can put it in a batch file and would like to register the batch file as a service. Thanks --Raghu

    D 1 Reply Last reply
    0
    • D draghu

      Hi all, Can somebody help me/point me on how to register an exe as a service. I googled for it but it lead to confusion more than any help. My exe would require a command line argument to start. So I can put it in a batch file and would like to register the batch file as a service. Thanks --Raghu

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      I seriously do not recommend doing this, but you can use SrvAny[^] to run an .EXE as a service.

      A guide to posting questions on CodeProject[^]
      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
           2006, 2007, 2008

      J D 2 Replies Last reply
      0
      • D Dave Kreskowiak

        I seriously do not recommend doing this, but you can use SrvAny[^] to run an .EXE as a service.

        A guide to posting questions on CodeProject[^]
        Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
             2006, 2007, 2008

        J Offline
        J Offline
        Jon_Boy
        wrote on last edited by
        #3

        Ditto. What is so hard about using InstallUtil? If you need an installer, use this KBA: http://support.microsoft.com/kb/816169

        Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

        D 1 Reply Last reply
        0
        • J Jon_Boy

          Ditto. What is so hard about using InstallUtil? If you need an installer, use this KBA: http://support.microsoft.com/kb/816169

          Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison

          D Offline
          D Offline
          draghu
          wrote on last edited by
          #4

          Hi Let me explain. :) I have an application built on VC++ 2005 (myApp.exe). I want to install it as a windows service. My application requires a an argument to start. How I do that. As I am new to this, I created a service with notepad.exe as the executable, but when I try to start it, this is what I got

          Error 1053: The service did not respond to the start or control request in a timely fashion

          I have the .net 2.0 framework installed. Only straight answers please. The one like .. >>Ditto. What is so hard about using InstallUtil? If you need an installer, use this KBA: by Jon_Boy is of no help, unless you are half bald ( or may be completely bald, you need to get bald to get the solution from Jon_Boy) Thanks --Raghu

          modified on Wednesday, May 27, 2009 6:43 AM

          D 1 Reply Last reply
          0
          • D Dave Kreskowiak

            I seriously do not recommend doing this, but you can use SrvAny[^] to run an .EXE as a service.

            A guide to posting questions on CodeProject[^]
            Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                 2006, 2007, 2008

            D Offline
            D Offline
            draghu
            wrote on last edited by
            #5

            srvany helps, but it do not result is a pure service. I found another tool for the same, lot better than srvany. http://sw4me.com/wiki/Winserv[^]

            D 1 Reply Last reply
            0
            • D draghu

              srvany helps, but it do not result is a pure service. I found another tool for the same, lot better than srvany. http://sw4me.com/wiki/Winserv[^]

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              Raghuveer D wrote:

              srvany helps, but it do not result is a pure service.

              Of course it doesn't! If the code is not written AS A SERVICE application, then it's NEVER going to be a "pure service", even if you use WinServ.

              A guide to posting questions on CodeProject[^]
              Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                   2006, 2007, 2008

              D 1 Reply Last reply
              0
              • D draghu

                Hi Let me explain. :) I have an application built on VC++ 2005 (myApp.exe). I want to install it as a windows service. My application requires a an argument to start. How I do that. As I am new to this, I created a service with notepad.exe as the executable, but when I try to start it, this is what I got

                Error 1053: The service did not respond to the start or control request in a timely fashion

                I have the .net 2.0 framework installed. Only straight answers please. The one like .. >>Ditto. What is so hard about using InstallUtil? If you need an installer, use this KBA: by Jon_Boy is of no help, unless you are half bald ( or may be completely bald, you need to get bald to get the solution from Jon_Boy) Thanks --Raghu

                modified on Wednesday, May 27, 2009 6:43 AM

                D Offline
                D Offline
                Dave Kreskowiak
                wrote on last edited by
                #7

                Raghuveer D wrote:

                unless you are half bald ( or may be completely bald, you need to get bald to get the solution from Jon_Boy)

                And that means what?? Bald people don't know what they're doing?? You're getting the error message because the ServiceManager is expecting a response to a Start command that it is not getting back. Why? Because your code is not written as a "pure service". Rewrite your application as a service and you won't have any of these problems. That is, if your not half-bald and really know how to write a proper service app...

                A guide to posting questions on CodeProject[^]
                Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                     2006, 2007, 2008

                D 1 Reply Last reply
                0
                • D Dave Kreskowiak

                  Raghuveer D wrote:

                  unless you are half bald ( or may be completely bald, you need to get bald to get the solution from Jon_Boy)

                  And that means what?? Bald people don't know what they're doing?? You're getting the error message because the ServiceManager is expecting a response to a Start command that it is not getting back. Why? Because your code is not written as a "pure service". Rewrite your application as a service and you won't have any of these problems. That is, if your not half-bald and really know how to write a proper service app...

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007, 2008

                  D Offline
                  D Offline
                  draghu
                  wrote on last edited by
                  #8

                  Sorry, I showed my frustration there. Anyways, people who know lot of things, seen lot of things get bald( not necessarily though). I always had that belief that bald guys have more information in their brains. Correct me if I am wrong.

                  1 Reply Last reply
                  0
                  • D Dave Kreskowiak

                    Raghuveer D wrote:

                    srvany helps, but it do not result is a pure service.

                    Of course it doesn't! If the code is not written AS A SERVICE application, then it's NEVER going to be a "pure service", even if you use WinServ.

                    A guide to posting questions on CodeProject[^]
                    Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                         2006, 2007, 2008

                    D Offline
                    D Offline
                    draghu
                    wrote on last edited by
                    #9

                    Yes, Dave, thanks for you reply. I have a question here. Is it lot of pain to convert my application to be re-written as a service. Thanks

                    D 1 Reply Last reply
                    0
                    • D draghu

                      Yes, Dave, thanks for you reply. I have a question here. Is it lot of pain to convert my application to be re-written as a service. Thanks

                      D Offline
                      D Offline
                      Dave Kreskowiak
                      wrote on last edited by
                      #10

                      Probably.

                      A guide to posting questions on CodeProject[^]
                      Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                           2006, 2007, 2008

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups