Title: First windows services                                 If you need copy same format use firefox or chrome or safari but iexplorer not work


Preview of Code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Linq;
using System.ServiceProcess;
using System.Text;
using System.Threading;
using System.IO;
 
namespace WindowsService1
{
    public partial class Service1 : ServiceBase
    {
        Thread th;
        bool isRunning = false;
 
        public Service1()
        {
            InitializeComponent();
        }
 
        protected override void OnStart(string[] args)
        {
            th = new Thread(DoThis);
            th.Start();
            isRunning = true;
 
 
        }
        private void DoThis()
        {
            while (isRunning)
            {
                File.AppendAllText(@"C:\Tasks\services.txt",Environment.NewLine+"  "+DateTime.Now.ToString("dddd dd/MM/yyyy hh:mm:ss"));
 
            }
 
        }
        protected override void OnStop()
        {
            isRunning = false;
            th = null;
        }
    }
}
 
@ECHO OFF
echo Installing WindowsService...
echo ---------------------------------------------------
cd\
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil.exe C:\MailWindowsServices\MailWindowsServices\bin\Debug\MailWindowsServices.exe
echo ---------------------------------------------------
echo Done.
 
 
@ECHO OFF
echo Installing WindowsService...
echo ---------------------------------------------------
cd\
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\installutil.exe /u C:\MailWindowsServices\MailWindowsServices\bin\Debug\MailWindowsServices.exe
echo ---------------------------------------------------
echo Done.