Boot Order

  • Thread starter Thread starter Paul
  • Start date Start date
P

Paul

How do I execute a program or command before windows
services are started. I want to copy a configuration file
for one of my services before the service loads.

I have looked into using the autoexec.bat or adding to the
registry entry
[HKEY_LOCAL_MACHINE\SYSTEM\Current
ControlSet\Control\Session Manager\BootExecute

But I haven't been able to figure it out.

Paul
 
Set the service startup to manual then create a shell script that does the
copy then net starts the service. Then use Task Scheduler to run the shell
script at startup.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
| How do I execute a program or command before windows
| services are started. I want to copy a configuration file
| for one of my services before the service loads.
|
| I have looked into using the autoexec.bat or adding to the
| registry entry
| [HKEY_LOCAL_MACHINE\SYSTEM\Current
| ControlSet\Control\Session Manager\BootExecute
|
| But I haven't been able to figure it out.
|
| Paul
 
Doesn't this mean that the service will then run when the
scripts start rather than earlier when the services
start? I think this will work but if there is an option
to do this without running the service later it would be
better.

Paul
 
Yes. No idea from here what your timing issues might be.

Another idea is to do it on the other end. This assumes the file is locked
until the service is stopped or you're not done collecting data or whatever.
In other words, in a shutdown script, net stop the service; *then* do the
file copy; *then* the machine shuts down (or restarts whichever the case)
Let me know on this and I can go into a little more detail.

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
| Doesn't this mean that the service will then run when the
| scripts start rather than earlier when the services
| start? I think this will work but if there is an option
| to do this without running the service later it would be
| better.
|
| Paul
 
I'll give the details. The service is macro software that
can launch tasks at startup (sort of ironic). The macro
software won't let me specify where its configuration file
is (if it did I could specify it to another drive and
aviod the whole problem) and I use an image of my computer
that I reload often and I want the configuration file to
be update when I re-image. Hope that makes sense.

Paul
 
Looks like it might be easiest to abandon the macro software. These articles
may also help.

How to Delay Loading of Specific Services
http://support.microsoft.com/default.aspx?kbid=193888



HOWTO: Create a User-Defined Service

http://support.microsoft.com/default.aspx?kbid=137890


--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


| I'll give the details. The service is macro software that
| can launch tasks at startup (sort of ironic). The macro
| software won't let me specify where its configuration file
| is (if it did I could specify it to another drive and
| aviod the whole problem) and I use an image of my computer
| that I reload often and I want the configuration file to
| be update when I re-image. Hope that makes sense.
|
| Paul
 
That actually seems like a good way of doing it, make a
new service and make the macro service dependent on it.

If I make the copy of a service does that service continue
to run and use memory/cpu cycles when it is done? If so
is it going to be enough to make a difference? I supose I
could make the copy service stop itself after it runs to
avoid wasting resources.

Thanks for all the help,
Paul
 
I wouldn't think that it would consume enough resource to worry about, but
yes you could just have it stop after the copy is complete and the other
service has started..

--
Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft Certified Professional
Microsoft MVP [Windows]
http://www.microsoft.com/protect


:
| That actually seems like a good way of doing it, make a
| new service and make the macro service dependent on it.
|
| If I make the copy of a service does that service continue
| to run and use memory/cpu cycles when it is done? If so
| is it going to be enough to make a difference? I supose I
| could make the copy service stop itself after it runs to
| avoid wasting resources.
|
| Thanks for all the help,
| Paul
 
Back
Top