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?

LVL 14
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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 :)

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.