We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

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

Matti
Matti asked
on
Medium Priority
319 Views
Last Modified: 2010-04-07
What I did try but not success:
Dim x&
x = ShellExecute(Me.hwnd, "open", App.Path & "\stopweb.vbs -a //10.0.0.3", 0, 0, vbNormal)

10.0.0.3 is my computers IP and it's name is Palvelin.

Does anyone have better parameters on this command line?

Matti
Comment
Watch Question

PowerShell Developer
CERTIFIED EXPERT
Top Expert 2010
Commented:

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.

Chris

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Hi!

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 .

Thanks!

Matti
Chris DentPowerShell Developer
CERTIFIED EXPERT
Top Expert 2010

Commented:

Glad I could help :)

Chris
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.