Old 19th July 2007, 11:27   #1
Junior Member
Join Date: Jul 2007
Posts: 17
Question Problem in stopping a service.


I am trying to stop few services for the installation of my software, One particular service is "IIS Admin Service" which depends on other service.
If I do it on command propmt writing:
net stop IISADMIN, It says:

>The following services are dependent on the IIS Admin >Service service.
>Stopping the IIS Admin Service service will also stop >these services.
> World Wide Web Publishing Service
>Do you want to continue this operation? (Y/N) [N]:

And here I need to press Y to stop.

My problem is that while using NSIS I want to automate this process without using the command prompt. ie I want to stop this service and any other service which depend on it without asking me.

I tried following two things but did not work...

a) services::SendServiceCommand 'stop' 'IISADMIN'

b) ExecDos::exec /NOUNLOAD /SYNC '"net stop /
IISADMIN"' "Y" "$EXEDIR\execdos.log"

I would be very thankful for anybody who can let me know for a solution of this.
123mobile is offline   Reply With Quote
Old 19th July 2007, 18:30   #2
Afrow UK
Afrow UK's Avatar
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434

Afrow UK is offline   Reply With Quote
Old 22nd July 2007, 09:01   #3
Junior Member
Join Date: Jul 2007
Posts: 17

Actually I should have search a little more on google before posting this question. The solution was easy. I am using this solution(for anyone who falls into the same trap!!)

pop $1 ;$1 contains the name of the service. ExecDos::exec /NOUNLOAD /ASYNC /DETAILED '"$vCOMSPEC" /C "net stop $1 /Y"' "" "$TEMP\output.log"

123mobile is offline   Reply With Quote
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