Re: Delay a Windows Service to start



WoW! I think that will work, I really appriciate your answer,

Regards, Joel :)

"Pegasus (MVP)" wrote:

I can't comment on your method since I have not tried it so
far. However, the following method will work. It will start
the "Windows Time" service some 60 seconds after you
start your own custom-made service.

1. Create the batch file c:\Windows\Joel.bat with these lines:
@echo off
%SystemRoot%\System32\cmd.exe /c echo Start %time% >> c:\test.txt
%SystemRoot%\System32\ping.exe localhost -n 60
%SystemRoot%\System32\net.exe start "Windows time"
%SystemRoot%\System32\cmd.exe /c echo End %time% >> c:\test.txt
%SystemRoot%\System32\cmd.exe /c echo. >> c:\test.txt

2. Go through the motions of this KB article:
http://support.microsoft.com/kb/137890
When entering the data for the "Application" value, enter this:
c:\windows\system32\cmd.exe /c c:\windows\Joel.bat

3. Manually stop the "Windows Time" service.

4. Manually start the service you have just created under the guidance
of the KB article.

5. Check the contents of c:\test.txt.

6. Adjust c:\windows\Joel.bat to suit your requirements.


"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@xxxxxxxxxxxxxxxx
Hi!
I took VS 2005 with the help of an article
http://msdn2.microsoft.com/en-us/library/zt39148a(VS.80).aspx
In the onStart I just put a loop because I tought that the service was
changing is status to started after going in the OnStart event. I'm really
not a Windows Service programmer specialist.

Regards, Joel :)
"Pegasus (MVP)" wrote:


"Joel" <Joel@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@xxxxxxxxxxxxxxxx
Bonjour!
I have a service that I want to delay because it needs to be up before
end.
So I created a Windows service (Delay Service) and my application will
start
after that service has started but it doesn't work. In the OnStart of
the
service I loop for one minute, but when I install the service and
start,
it
automatically say's it is started even if I have that loop.
Does someone had a similar and how did you solved it??

Regards Joel :)

How did you create this service? What are its commands?
How did you implement the delay?






.



Relevant Pages

  • Re: Delay a Windows Service to start
    ... the "Windows Time" service some 60 seconds after you ... Create the batch file c:\Windows\Joel.bat with these lines: ... In the onStart I just put a loop because I tought that the service was ... So I created a Windows service (Delay Service) and my application ...
    (microsoft.public.windows.server.general)
  • Re: Delay a Windows Service to start
    ... the "Windows Time" service some 60 seconds after you ... In the onStart I just put a loop because I tought that the service was ... I have a service that I want to delay because it needs to be up before ...
    (microsoft.public.windows.server.general)
  • Re: Black screen with cursor at startup
    ... Pegasus (MVP) a écrit: ... sorry for the delay but i got a lot to do lately. ... Make sure your boot partition is marked "active". ...
    (microsoft.public.win2000.general)

Loading