• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

I'm trying to automate IIS 5.1 AdminScripts from my local VB program.

What I did try but not success:
Dim x&
x = ShellExecute(Me.hwnd, "open", App.Path & "\stopweb.vbs -a //", 0, 0, vbNormal) is my computers IP and it's name is Palvelin.

Does anyone have better parameters on this command line?

  • 2
1 Solution
Chris DentPowerShell DeveloperCommented:

You're not passing the right parameters into the Stop Script. What exactly are you trying to achieve?

If it's the Default Website you want to stop then the syntax is:

StopWeb.vbs -c palvelin -a 1

(Palvelin can be the IP Address, just don't include the //).

For note...

StopWeb.vbs has an optional Argument of "-c <Computer>", and a mandatory Argument of "-a <SiteID>" which is the ID of the Site you actually want to stop.

If you want to Stop all the sites on the Server then it is possible to loop through all the Website instances under the W3SVC Node in the Metabase but this isn't something StopWeb achieves.

MattiAuthor Commented:

This worked, thanks for the syntax
x = ShellExecute(Me.hwnd, "open", App.Path + "\StopWeb.vbs", "-c matti -a 1", 0, vbNormal)

I have a VB IIS application which has some problems but when site is restarted the app goes up again. So I needed to scheduled stop/restart automated just for a moment .


Chris DentPowerShell DeveloperCommented:

Glad I could help :)

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now