Results 1 to 4 of 4

Thread: [2005] Make serivce to run backup app Bonus: In express

  1. #1

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    [2005] Make serivce to run backup app Bonus: In express

    we just got a project to run a program (syncback.exe) but the program will die when we log out

    I would like to create a service that will run this program "in the background" but 1) i only have access to the 05 and 08 express editions ( i can get the full suit but its a pain in the rump at work)

    is there anyway to create a serivce in express


    and once I have the service created how do I make sure the app is always running

    should i just use the timer.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] Make serivce to run backup app Bonus: In express

    VB Express does not include the project template for a Windows Service so you have to either build it from scratch or else download and install a project template that someone else has created. If you search the Web you should be able to find one for 2005 at least, which should probably work in 2008 too.

    What do you mean by:
    the program will die
    You can create a Process object for that process and handle its Exited event but I'm not sure it will be raised if the process ends abnormally. Regardless, you can use Process.GetProcessesByName to determine whether the app is running and, if it is, get a Process object for it. You can also use Process.Start to start it if it's not running, which will also get you a Process object.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Fanatic Member Crash893's Avatar
    Join Date
    Dec 2005
    Posts
    930

    Re: [2005] Make serivce to run backup app Bonus: In express

    http://www.eggheadcafe.com/fileupload/706982384_Windows Service.zip

    Just place the file in C:\Documents and Settings\YOUR USERNAME\My Documents\Visual Studio 2005\Templates\ProjectTemplates

  4. #4
    PowerPoster Deepak Sakpal's Avatar
    Join Date
    Mar 2002
    Location
    Mumbai, India
    Posts
    2,424

    Re: [2005] Make serivce to run backup app Bonus: In express

    Basically you cannot have exe files running when windows is in log off mode. If you want that exe to survive in log off mode then you need to convert that exe to windows service. The Windows NT/2000 Resource Kit provides some utilities that converts any exe into windows service. Have a look at this article. Hope this helps.

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