Solved

how to delay start a service?

Posted on 2003-11-13
9
19,033 Views
Last Modified: 2010-04-19
Dear Experts,

I have custom mail sending program that only works properly when I manually start its service after windows 2003 server has completed all of its loading after reboot.

Using a Command Prompt I can manually start it as follow:

C:\sendmail\SRService.exe -s

How do I schedule this service to start so that it starts LAST after everything else complete loading? another way is delay in say 5 minutes?

FYI: this WIndows 2003 Server has been applied Hight Security template that came with the Microsoft Security Guide for Windows 2003 that I downloaded from Microsoft site.

Thanks,

Andre
CommerceShore
0
Comment
Question by:andreni78
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 32

Expert Comment

by:LucF
ID: 9738689
Why not using the taskmanager to run it after a reboot? Schedule it to run only after let's say 2 minutes of inactivity. This makes sure everything has started before this program runs.

LucF
0
 
LVL 15

Expert Comment

by:Rob Stone
ID: 9738835
You could use TIMEOUT which is on the NT4 Resource kit and then the line you use in a batch file.  Not sure if its on the 2000 resource kit.
0
 
LVL 4

Expert Comment

by:darth_wannabe
ID: 9741618
Set the service to Manual instead of Automatic. (right-click my computer, manage, services)

Create a new batch file and put it somewhere.

in the batch file, do this:

@echo off
cls
sleep 300
NET START SERVICENAME*

*the name of the service you want to start

Add a shortcut to the batch file to your startup (in the start menu). Adjust the time to sleep to be whatever you want.
0
Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

 

Author Comment

by:andreni78
ID: 9757848
darth_wannabe,

That is the best answer with step by step. I love it. I will try it and let you know.

Thanks,

Andre
0
 
LVL 4

Accepted Solution

by:
darth_wannabe earned 500 total points
ID: 9763627
just reread the post....rather than using net start, you can just run your command as well. So you can replace net start with your C:\sendmail\SRService.exe -s command
0
 

Expert Comment

by:clarkgodfrey
ID: 23982614
This is great. But how do you run this at startup NOT logon. As on a 2003 server after reboot that might not have anybody log on?
0
 

Expert Comment

by:Darren_Clifford
ID: 25693608
You could use group policy to apply a startup script with teh similar netstart commands in it
0
 

Expert Comment

by:slyhill
ID: 31195619
Create a dependancy on the service:

http://support.microsoft.com/kb/193888
0
 
LVL 4

Expert Comment

by:darth_wannabe
ID: 31202277
one of the advanced scheduling options in a scheduled task is to run on system startup. You can use that as well. just make sure that the credentials you supply fo the scheduled job has access to do that.
0

Featured Post

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question