?
Solved

Stoping IIS serverV1

Posted on 2000-03-08
2
Medium Priority
?
194 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 800 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses
Course of the Month8 days, 12 hours left to enroll

764 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