Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > Windows Server

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-08-2008, 11:49 AM
=?Utf-8?B?Sm9lbA==?=
 
Posts: n/a
Delay a Windows Service to start

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
Reply With Quote
  #2 (permalink)  
Old 04-08-2008, 01:01 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: Delay a Windows Service to start


"Joel" <Joel@discussions.microsoft.com> wrote in message
news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
> 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?


Reply With Quote
  #3 (permalink)  
Old 04-08-2008, 02:36 PM
=?Utf-8?B?Sm9lbA==?=
 
Posts: n/a
Re: Delay a Windows Service to start

Hi!
I took VS 2005 with the help of an article
http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
> > 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?
>
>
>

Reply With Quote
  #4 (permalink)  
Old 04-08-2008, 03:41 PM
Jabez Gan [MVP]
 
Posts: n/a
Re: Delay a Windows Service to start

Hmmm... Maybe you should be posting this under VS's newsgroup?

--
Jabez Gan
Microsoft MVP: Windows Server
http://www.msblog.org


"Joel" <Joel@discussions.microsoft.com> wrote in message
news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@microsoft.com...
> Hi!
> I took VS 2005 with the help of an article
> http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
>> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
>> > 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?
>>
>>
>>


Reply With Quote
  #5 (permalink)  
Old 04-08-2008, 04:10 PM
=?Utf-8?B?Sm9lbA==?=
 
Posts: n/a
Re: Delay a Windows Service to start

Ok Thanks

"Jabez Gan [MVP]" wrote:

> Hmmm... Maybe you should be posting this under VS's newsgroup?
>
> --
> Jabez Gan
> Microsoft MVP: Windows Server
> http://www.msblog.org
>
>
> "Joel" <Joel@discussions.microsoft.com> wrote in message
> news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@microsoft.com...
> > Hi!
> > I took VS 2005 with the help of an article
> > http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
> >> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
> >> > 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?
> >>
> >>
> >>

>
>

Reply With Quote
  #6 (permalink)  
Old 04-08-2008, 05:18 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: Delay a Windows Service to start

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@discussions.microsoft.com> wrote in message
news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@microsoft.com...
> Hi!
> I took VS 2005 with the help of an article
> http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
>> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
>> > 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?
>>
>>
>>



Reply With Quote
  #7 (permalink)  
Old 04-08-2008, 06:12 PM
=?Utf-8?B?Sm9lbA==?=
 
Posts: n/a
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@discussions.microsoft.com> wrote in message
> news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@microsoft.com...
> > Hi!
> > I took VS 2005 with the help of an article
> > http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
> >> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
> >> > 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?
> >>
> >>
> >>

>
>
>

Reply With Quote
  #8 (permalink)  
Old 04-08-2008, 07:54 PM
Pegasus \(MVP\)
 
Posts: n/a
Re: Delay a Windows Service to start

You can probably improve the method by adding this line
to your batch file:
%SystemRoot%\System32\net.exe stop "NameOfYourService"
since there is no need for your service to keep on running after
it has delay-started the original service. Let me know how you go!

"Joel" <Joel@discussions.microsoft.com> wrote in message
news:1E1B9C32-A6B3-42B0-8880-A197B460FBE7@microsoft.com...
> 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@discussions.microsoft.com> wrote in message
>> news:4FE66034-A426-4F99-ADE2-FB30C5C0DEF2@microsoft.com...
>> > Hi!
>> > I took VS 2005 with the help of an article
>> > http://msdn2.microsoft.com/en-us/lib...8a(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@discussions.microsoft.com> wrote in message
>> >> news:E0C46BBB-2149-4C9B-9CE6-51DF2154996B@microsoft.com...
>> >> > 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?
>> >>
>> >>
>> >>

>>
>>
>>



Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > Windows Server


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:34 PM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Homes for Sale | Loans | Loans | Loans | Remortgaging



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114