Solved

Stoping IIS serverV1

Posted on 2000-03-08
2
189 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
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now