Create new website

Discussion in 'Scripting' started by Baur, May 25, 2005.

  1. Baur

    Baur Guest

    I've found a scrip in the homepage, but i doesn't work probertly on my server..
    I'll hope you can help..
    I got this error:
    error '80041003'
    /page/prove.asp, line 3
    And the script is:
    <%
    strComputer = "."
    Set objWMIService = GetObject _
    ("winmgmts:{authenticationLevel=pktPrivacy}\\" _
    & strComputer & "\root\microsoftiisv2")

    Set objWebService = objWMIService.ExecQuery _
    ("Select * From IISWebService")

    arrBindings = Array(0)
    Set arrBindings(0) = _
    objWMIService.Get("ServerBinding").SpawnInstance_()
    arrBindings(0).IP = "192.168.1.1"
    arrBindings(0).Port = "8383"
    arrBindings(0).Hostname = "atl-ws-01"

    For Each objItem in objWebService
    objItem.CreateNewSite "Test Site", arrBindings, _
    "c:\inetpub\wwwroot"
    Next

    %>
     
    Baur, May 25, 2005
    #1
    1. Advertisements

  2. Baur

    AustinJames Guest

    Did you try giving the webpage an .hta extension? This script won't run in a
    basic HTML file. The HTA extension will allow the script to be run...

    Austin
     
    AustinJames, May 25, 2005
    #2
    1. Advertisements

  3. Baur

    Baur Guest

    No i haven't but how do you do that ?...

     
    Baur, Jul 6, 2005
    #3
  4. Just rename the file containing the html code such that its extension is
    ..HTA instead of .HTM or .HTML.

    /Al
     
    Al Dunbar [MS-MVP], Jul 6, 2005
    #4
  5. Baur

    Baur Guest

    But then i'm going on the index.hta the browser will download the file, shall
    i not do something in the iis ?...
     
    Baur, Jul 8, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.