Old 25th March 2010, 21:06   #1
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
Stop and Start Website on IIS

I am trying to stop and start the website for my web service so that after the install the correct version is running on IIS.
whourdady is offline   Reply With Quote
Old 26th March 2010, 05:01   #2
msroboto
Junior Member
 
Join Date: Sep 2006
Posts: 47
cscript %WinDir%\System32\iisweb.vbs /stop "%WebServer%"


cscript %WinDir%\System32\iisweb.vbs /start "%WebServer%"

there might be another way but if you want to stop one web server this is it
msroboto is offline   Reply With Quote
Old 26th March 2010, 14:47   #3
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
Thank your for helping, this worked
whourdady is offline   Reply With Quote
Old 30th March 2010, 01:50   #4
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
Rather start and stop the web server you may find it better to start and stop teh site

http://www.microsoft.com/technet/pro....mspx?mfr=true

For IIS 6.0

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 1st April 2010, 05:37   #5
msroboto
Junior Member
 
Join Date: Sep 2006
Posts: 47
The code I sent him does stop the site.

There may be other ways for sure but that's what that does.
msroboto is offline   Reply With Quote
Old 4th April 2010, 02:36   #6
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
I was just pointing out that that will stop the web server service rather than a specfic site which the OP indicted he needed.

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 4th May 2010, 15:42   #7
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
Ok I am having problems running this inside of the installer in cmd prompt this works

iisweb /stop WebService

code in nullsoft is

ExecWait '"cscript" iisweb.vbs /stop WebService'

ive also tried

ExecWait '"cscript" %WinDir%\System32\iisweb.vbs /stop "WebService"'

any help is appreciated
whourdady is offline   Reply With Quote
Old 4th May 2010, 16:08   #8
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
Ok I have changed the code to

PUSH $R0
ReadEnvStr $R0 "COMSPEC"
ExecWait '$R0 /C "iisweb.vbs /stop WebService"'

but when i put

ExecWait '$R0 /C cscript "iisweb.vbs /stop WebService"'

it does not work correctly
whourdady is offline   Reply With Quote
Old 4th May 2010, 16:59   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Try:
ExecWait '"$R0" /C cscript iisweb.vbs /stop WebService'

Also if you use /K instead of /C the command window will stay open so you can see any issues.

Stu
Afrow UK is offline   Reply With Quote
Old 4th May 2010, 17:14   #10
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
hey Afrow,

with ExecWait '"$R0" /C cscript iisweb.vbs /stop WebService'

the command window does not even open
whourdady is offline   Reply With Quote
Old 4th May 2010, 17:20   #11
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
ExecWait '$R0 /K cscript "iisweb.vbs /stop WebService"'

Ok the error i receive with this is

Input Error: There is no file extension in C:\iisweb.vbs \stop WebService
whourdady is offline   Reply With Quote
Old 4th May 2010, 17:33   #12
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Quote:
Originally Posted by whourdady View Post
hey Afrow,

with ExecWait '"$R0" /C cscript iisweb.vbs /stop WebService'

the command window does not even open
It probably does but disappears before you see it. You need those quotes in case the path to cmd.exe contains spaces (it never should but you never know). Does using a full path to the VBS (in quotes) work?

e.g.
code:
ExecWait `"$R0" /C cscript "C:\some\iisweb.vbs" /stop WebService`
Edit: Everything after the /C is what you'd type in command prompt itself. If it doesn't work in command prompt then don't expect it to work on the command line either.

Stu
Afrow UK is offline   Reply With Quote
Old 4th May 2010, 17:42   #13
whourdady
Junior Member
 
Join Date: Mar 2010
Posts: 17
you are right, I just got it working as you posted it.

ExecWait '$R0 /C cscript "%WinDir%\System32\iisweb.vbs" /stop WebService'

I could not have gotten this without your help thanks Afrow UK
whourdady is offline   Reply With Quote
Old 4th May 2010, 18:09   #14
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should use $SYSDIR\iisweb.vbs rather than that path.

Stu
Afrow UK 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