Old 11th July 2014, 07:50   #1
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 343
Question Service Start Type automatic delayed start

hi
i use for change Service Start Type from code:

HTML Code:
SimpleSC::SetServiceStartType "wuauserv" "2" ;automatic
SimpleSC::SetServiceStartType "wuauserv" "3" ;manual
SimpleSC::SetServiceStartType "wuauserv" "4" ;disabled
i how can change to automatic delayed start?
thanks
r2du-soft is offline   Reply With Quote
Old 11th July 2014, 09:06   #2
th_mi
Member
 
Join Date: Sep 2005
Location: Sitting next to my desk
Posts: 56
Check out this:
http://blogs.technet.com/b/askperf/a...tic-start.aspx

This signature is currently on vacation!
th_mi is offline   Reply With Quote
Old 11th July 2014, 09:49   #3
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
How about SimpleSC::SetServiceDelayedAutoStartInfo?
jpderuiter is offline   Reply With Quote
Old 11th July 2014, 14:49   #4
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 343
Question

Quote:
Originally Posted by th_mi View Post
Thanks i read this.
I knew can change a value in registry for change Start Type to automatic delayed start.
but i I do not want change value in registry and i want do this work with NSIS command.
This is a bug in!!!! if nsis haven't a parameter for change Start Type to automatic delayed start?


Quote:
Originally Posted by jpderuiter View Post
How about SimpleSC::SetServiceDelayedAutoStartInfo?
when i use from:
HTML Code:
SimpleSC::SetServiceDelayedAutoStartInfo "wuauserv" "5"
Pop $0
MessageBox MB_OK "$0"
i see in MessageBox number 0 !!!!!
my service is start and Start type in automatic (delayed start)!!!!!
r2du-soft is offline   Reply With Quote
Old 13th July 2014, 22:53   #5
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
Why do you use 5 as a parameter?
Only 0 and 1 are supported...
Quote:
delayed_autostart - The delayed auto-start setting of an auto-start service
- 0 - The service will be started during system boot.
- 1 - The service will be started after other auto-start services are started plus a short delay
BTW: please don't use exclamation marks, as it's very annoying, certainly when it turns out you didn't read the manual good enough...
jpderuiter is offline   Reply With Quote
Old 14th July 2014, 05:56   #6
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 343
Quote:
Originally Posted by jpderuiter View Post
Why do you use 5 as a parameter?
Only 0 and 1 are supported...BTW: please don't use exclamation marks, as it's very annoying, certainly when it turns out you didn't read the manual good enough...
Thanks mr jpderuiter
i before test all parameters 0 till 5 later.
when copy command to that post i not change 5 to 1.
i test again parameters 0 and 1 but not work
r2du-soft is offline   Reply With Quote
Old 14th July 2014, 07:06   #7
jpderuiter
Major Dude
 
Join Date: Feb 2007
Posts: 672
So, what is not working?
Rereading your post it says that it's working:
Quote:
Originally Posted by r2du-soft View Post
my service is start and Start type in automatic (delayed start)
Did you reboot your PC?
MSDN says you should
Quote:
Originally Posted by MSDN;http://msdn.microsoft.com/en-us/library/windows/desktop/ms685155(v=vs.85).aspx
The change takes effect the next time the system is started.
jpderuiter is offline   Reply With Quote
Old 14th July 2014, 07:50   #8
r2du-soft
Senior Member
 
r2du-soft's Avatar
 
Join Date: Nov 2013
Location: Iran
Posts: 343
Post

Quote:
Originally Posted by jpderuiter View Post
So, what is not working?
Rereading your post it says that it's workingid you reboot your PC?
MSDN says you should
oooooo
im so sorry

this work and set Startup Type service to AUTOMATIC:

HTML Code:
SimpleSC::SetServiceStartType "wuauserv" "2" ;automatic
i set manual startup type to disable and use from you're code:

HTML Code:
SimpleSC::SetServiceDelayedAutoStartInfo "wuauserv" "1"
but not change to AUTOMATIC (Delay Start).

after i use them together:

HTML Code:
SimpleSC::SetServiceStartType "wuauserv" "2" ;Set Automatic
SimpleSC::SetServiceDelayedAutoStartInfo "wuauserv" "1" ;Set Automatic To Delay Start
and worked very good. (after change to automatic can change that to automatic delay start).

It was a mistake on my behalf

Thanks For Help Mr jpderuiter
My Problem Solved
r2du-soft is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump