[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-03-20
3
Medium Priority
?
282 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
0
Comment
Question by:Matti
  • 2
3 Comments
 
LVL 71

Accepted Solution

by:
Chris Dent earned 1000 total points
ID: 16238797

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
0
 
LVL 14

Author Comment

by:Matti
ID: 16238968
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
0
 
LVL 71

Expert Comment

by:Chris Dent
ID: 16239069

Glad I could help :)

Chris
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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 Month18 days, 1 hour left to enroll

830 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