lmenaria
4th April 2006 08:49 UTC
Start Windows Service Automatically
Hello everyone,
I have created a windows service using NSIS script and Installed it, It has AUTO option, I want to Start Automatically while Installation in Done, without restart Machine or Manual Start.
Pls Suggest me
thanks
LM
flizebogen
4th April 2006 11:43 UTC
You can invoke the windows command line tool net
netstart
"servicename"
Call this via the exec or execwait command and check if the error flag is set.
Brummelchen
4th April 2006 12:55 UTC
net start
and
net use
are your friends.
but be aware that the settings of service allow to stop it.
some services were set in all 3 failures to restart again
- they are unstopable
try to set their behaviour from atuomatic to manual/disabled before
read
http://technet2.microsoft.com/Window...df35f1033.mspx
it is something like
sc config <service> start= disabled
or
sc config <service> start= demand
# in german
http://www.microsoft.com/technet/pro....mspx?mfr=true
lmenaria
5th April 2006 06:25 UTC
Thanks
Yathosho
8th April 2006 12:21 UTC
so what do you guys prefer to use? nsexec doing net start/stop or the services plugin? pro and cons?
kichik
8th April 2006 13:00 UTC
A plug-in, which in turn uses a documented API, is the best option in my opinion. net.exe is a user-end tool, which may not exist on all systems and may change its interface over versions. On the other end, net.exe is simpler to use than API. But the plug-ins should solve that by providing their own documented interface above the API.