Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6352677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:16:12+00:00 2026-05-24T22:16:12+00:00

I am trying to create my first Windows Service, but so sad… after I

  • 0

I am trying to create my first Windows Service, but so sad… after I started the service manually from services.msc, the message ‘the service on local computer started and then stopped. some services stop automatically is they have no work to do’

I am sure there must be some mistake in my code…

namespace ConvertService
{
public partial class Service1 : ServiceBase
{
    public Service1()
    {
        this.ServiceName = "ConvertService";
        this.EventLog.Log = "Application";
    }
    static void main()
    {

        ServiceBase.Run(new Service1());
    }


    protected override void OnStart(string[] args)
    {
        Process pMP3 = new Process();
        pMP3.StartInfo.UseShellExecute = false;
        pMP3.StartInfo.RedirectStandardOutput = true;
        pMP3.StartInfo.FileName = @"d:\...path...\converter.exe";
        pMP3.StartInfo.Arguments = @"d:\...path...\tempamr.amr " + @"d:\...path...\tempmp3.mp3 " + @"-cmp3";
        pMP3.Start();
        pMP3.WaitForExit();
        Process pWAV = new Process();
        pWAV.StartInfo.UseShellExecute = false;
        pWAV.StartInfo.RedirectStandardOutput = true;
        pWAV.StartInfo.FileName = @"d:\...path...\converter.exe";
        pWAV.StartInfo.Arguments = @"d:\...path...\tempmp3.mp3 " + @"d:\...path...\tempwav.wav " + @"-cwav";
        pWAV.Start();
        pWAV.WaitForExit();

    }

    protected override void OnStop()
    {
    }
}

}

Forgive me if i did silly mistakes. This is my very very first Windows Service.

PS. I have already ticked ‘Allow service to interact with desktop’

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:16:14+00:00Added an answer on May 24, 2026 at 10:16 pm

    Check to make sure the account your service runs under can access those files (including write access for the .wav and .mp3 files).

    Your code might also be causing an unhandled exception. I’m not sure, but that might be visible in the event log. You can also get your service to write out messages explicitly to the event log (like in the case of an exception); check out this link: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create my first Windows phone application but I keep getting
I'm trying to create my first app with AngularJS. It looks neat, but there's
I'm trying to create an installer for a Windows Service I developed. This installer
I am trying to create my first C++ exeecutable using Eclipse IDE (using Windows
I am trying to create my first dynamic site on windows server 2008 r2.
I am trying to create my first C++ executable program with Eclipse in Windows
I am trying to create my first custom Print Dialog in C#. I found
I'm trying to create my first data mart. I am creating my dimension table
I am trying to create my first GUI application using (Java + Eclipse +
I'm using opengl and trying to create a first person camera. All examples use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.