Solved

Stoping IIS serverV1

Posted on 2000-03-08
2
193 Views
Last Modified: 2010-05-02
hi

Does anyone have any idea how to stop the IIS http server programaticly with VB? just as it the "stop" button was pressed on the management console?


thanks
0
Comment
Question by:martinnetquote
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Author Comment

by:martinnetquote
ID: 2599187
Adjusted points to 200
0
 

Accepted Solution

by:
kwk earned 200 total points
ID: 2599635
Hi
It's pretty simple

Private Sub CmdStop_Click()
    Path = "IIS://localhost/W3SVC/1"
    Action = "setstate"
    Set currentobj = GetObject(Path)
    currentobj.Stop
End Sub

Private Sub CmdStart_Click()
    Path = "IIS://localhost/W3SVC/1"
    Action = "setstate"
    Set currentobj = GetObject(Path)
    currentobj.Start
End Sub


In the path string, the number at the end, is the iis' internal reference to the website. Se below if you don't know how to find it.


To find the websites number:

In the MMC
- Click the website that you will find.
- Rightclick and choose properties
- Click properties on the button next to the loggin settings

You will now see the logfilename.
It starts in the directory "W3SVC1"
The number in the end of W3SVC1 is the number you want to see.

Good luck

Sincerely

Kim Kähler




0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question