CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 16

Hybrid View

  1. #1
    Join Date
    Feb 2005
    Posts
    568

    Run console application as windows service

    is it possible i run console application as windows service or wrap an console application as windows service...
    pls provide some sample...

  2. #2
    Join Date
    Mar 2004
    Location
    Prague, Czech Republic, EU
    Posts
    1,701

    Re: Run console application as windows service

    Not as it is. You need specialized program which will run as service and host the console application. Look e.g. at FireDaemon.
    • Make it run.
    • Make it right.
    • Make it fast.

    Don't hesitate to rate my post.

  3. #3
    Join Date
    Feb 2005
    Posts
    568

    Re: Run console application as windows service

    Can anyone show how can i use visual studio to create this?

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Run console application as windows service

    Quote Originally Posted by lsy
    Can anyone show how can i use visual studio to create this?
    Are you asking how to create a Windows Service in Visual Studio? If so, what Visual Studio version are you using?

  5. #5
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: Run console application as windows service


  6. #6
    Join Date
    Feb 2005
    Posts
    568

    Re: Run console application as windows service

    sorry, i still don't know what is that abt?? do there have any simple example?

  7. #7
    Join Date
    Apr 2007
    Location
    Florida
    Posts
    403

    Re: Run console application as windows service

    That is a very very basic sample. I would suggest going back to that link and reading up on it. It's very easy to use. Just copy paste it in your project and mess around with it.

  8. #8
    Join Date
    Feb 2005
    Posts
    568

    Re: Run console application as windows service

    Quote Originally Posted by mariocatch
    That is a very very basic sample. I would suggest going back to that link and reading up on it. It's very easy to use. Just copy paste it in your project and mess around with it.
    I can create using the default template in visual studio->windows service right??
    do u have any website which start from there?? it seems more easy!

  9. #9
    Join Date
    Feb 2005
    Posts
    568

    Re: Run console application as windows service

    i followed this website to create the service...
    http://avinashkt.blogspot.com/2007/0...s-service.html
    After i install the service it show success... but when i try to start the service it show...

    Error 1083: the executable program that this service is configured to run in does not implement the service

    how can i resolve this?

  10. #10
    Join Date
    Mar 2004
    Location
    33°11'18.10"N 96°45'20.28"W
    Posts
    1,808

    Re: Run console application as windows service

    IMO its a pretty useful too though. you don't always have the ability to alter a command line app (say, like some 3rd party utility) to be a windows service, and in instances like that, or where its not cost effective I think a service wrapper app like this is a great idea. similar btw to daemontools in linux which is like a windows services in windows but lets you run command line apps (which windows does not).
    Last edited by MadHatter; May 10th, 2011 at 08:19 PM.

  11. #11
    Join Date
    May 2011
    Posts
    3

    Re: Run console application as windows service

    Quote Originally Posted by lsy View Post
    is it possible i run console application as windows service or wrap an console application as windows service...
    pls provide some sample...
    I had the same problem and did exactly what you suggested, created a wrapper. That way I didn't have to modify my existing console applications. I posted it here: http://runasservice.com/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured