Solved

Stoping IIS serverV1

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
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…
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…

746 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

12 Experts available now in Live!

Get 1:1 Help Now