Create ASP.Net web app with command line

Discussion in 'ASP .Net' started by =?Utf-8?B?TWFyaw==?=, Jan 11, 2005.

  1. Hello,
    I'm trying to install an ASP.Net project using the command line (SDK tools
    & perhaps IIS Admin scripts?)

    Does anyone know of an automatic, command-line-driven way, to creat the
    ASP.Net virtual directory, essentially mimicking whatever VS.Net does when it
    creates a web project?

    Ideally it would be as simple as "CreateAspWebApp.bat virtualPath
    PhysicalPath"

    I thought something like:
    cd %windir%\Microsoft.NET\Framework\v1.1.4322
    Aspnet_regiis -sn W3SVC/1/ROOT/SampleApp1

    would do it, but this requires that I first have a virtual directory. So
    then I run this first:
    cd C:\Inetpub\AdminScripts
    mkwebdir -c localhost -w "Default Web Site" -v
    "SampleApp1","C:\Develop\SampleApp1\"

    The problem is that I still need to manually go into the IIS GUI console, go
    to the web's property page, VirturalDirectory tab, and set its Execute
    Permissions = "Scripts Only" (default is none) and click the "Create" button
    next to the Application Name textbox.

    Thanks,
    Mark
    =?Utf-8?B?TWFyaw==?=, Jan 11, 2005
    #1
    1. Advertising

  2. You didn't mention whether you're
    using IIS 5.x of IIS 6.0, but at this page :
    http://www.microsoft.com/technet/scriptcenter/scripts/iis/default.mspx

    youll find sample scripts to do what
    you want to do in both versions.



    Juan T. Llibre
    ASP.NET MVP
    ===========
    "Mark" <> wrote in message
    news:...
    > Hello,
    > I'm trying to install an ASP.Net project using the command line (SDK tools
    > & perhaps IIS Admin scripts?)
    >
    > Does anyone know of an automatic, command-line-driven way, to creat the
    > ASP.Net virtual directory, essentially mimicking whatever VS.Net does when
    > it
    > creates a web project?
    >
    > Ideally it would be as simple as "CreateAspWebApp.bat virtualPath
    > PhysicalPath"
    >
    > I thought something like:
    > cd %windir%\Microsoft.NET\Framework\v1.1.4322
    > Aspnet_regiis -sn W3SVC/1/ROOT/SampleApp1
    >
    > would do it, but this requires that I first have a virtual directory. So
    > then I run this first:
    > cd C:\Inetpub\AdminScripts
    > mkwebdir -c localhost -w "Default Web Site" -v
    > "SampleApp1","C:\Develop\SampleApp1\"
    >
    > The problem is that I still need to manually go into the IIS GUI console,
    > go
    > to the web's property page, VirturalDirectory tab, and set its Execute
    > Permissions = "Scripts Only" (default is none) and click the "Create"
    > button
    > next to the Application Name textbox.
    >
    > Thanks,
    > Mark
    >
    Juan T. Llibre, Jan 11, 2005
    #2
    1. Advertising

  3. Hello Juan,
    Thanks for the post. I'm using IIS 5.1.
    I had checked out that sight before posting here. The closest script I can
    see on there is "Create an Application in a Web Directory". That script reads:

    strComputer = "LocalHost"
    Set objIIS = GetObject _
    ("IIS://" & strComputer & "/W3SVC/2142295254/root/aspnet_client_folder")
    objIIS.AppCreate(False)

    The problem is that I don't see where to set the physical directory of the
    application source code (such as "C:\inetpub\wwwroot\myApp1").
    Any advice?
    Thanks,
    Mark

    "Juan T. Llibre" wrote:

    > You didn't mention whether you're
    > using IIS 5.x of IIS 6.0, but at this page :
    > http://www.microsoft.com/technet/scriptcenter/scripts/iis/default.mspx
    >
    > youll find sample scripts to do what
    > you want to do in both versions.
    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > ===========
    > "Mark" <> wrote in message
    > news:...
    > > Hello,
    > > I'm trying to install an ASP.Net project using the command line (SDK tools
    > > & perhaps IIS Admin scripts?)
    > >
    > > Does anyone know of an automatic, command-line-driven way, to creat the
    > > ASP.Net virtual directory, essentially mimicking whatever VS.Net does when
    > > it
    > > creates a web project?
    > >
    > > Ideally it would be as simple as "CreateAspWebApp.bat virtualPath
    > > PhysicalPath"
    > >
    > > I thought something like:
    > > cd %windir%\Microsoft.NET\Framework\v1.1.4322
    > > Aspnet_regiis -sn W3SVC/1/ROOT/SampleApp1
    > >
    > > would do it, but this requires that I first have a virtual directory. So
    > > then I run this first:
    > > cd C:\Inetpub\AdminScripts
    > > mkwebdir -c localhost -w "Default Web Site" -v
    > > "SampleApp1","C:\Develop\SampleApp1\"
    > >
    > > The problem is that I still need to manually go into the IIS GUI console,
    > > go
    > > to the web's property page, VirturalDirectory tab, and set its Execute
    > > Permissions = "Scripts Only" (default is none) and click the "Create"
    > > button
    > > next to the Application Name textbox.
    > >
    > > Thanks,
    > > Mark
    > >

    >
    >
    >
    =?Utf-8?B?TWFyaw==?=, Jan 11, 2005
    #3
  4. In IIS 6, there's %SystemRoot%\System32\IIsVdir.vbs
    and %SystemRoot%\System32\IIsWeb.vbs which let
    you do it.

    I don't know if there's scripts for IIS 5.x which do that.

    You could try using System.DirectoryServices.
    http://msdn.microsoft.com/library/d..._directory_using_system_directoryservices.asp

    There's an example in C# there.





    Juan T. Llibre
    ASP.NET MVP
    ===========
    "Mark" <> wrote in message
    news:...
    > Hello Juan,
    > Thanks for the post. I'm using IIS 5.1.
    > I had checked out that sight before posting here. The closest script I can
    > see on there is "Create an Application in a Web Directory". That script
    > reads:
    >
    > strComputer = "LocalHost"
    > Set objIIS = GetObject _
    > ("IIS://" & strComputer &
    > "/W3SVC/2142295254/root/aspnet_client_folder")
    > objIIS.AppCreate(False)
    >
    > The problem is that I don't see where to set the physical directory of the
    > application source code (such as "C:\inetpub\wwwroot\myApp1").
    > Any advice?
    > Thanks,
    > Mark
    >
    > "Juan T. Llibre" wrote:
    >
    >> You didn't mention whether you're
    >> using IIS 5.x of IIS 6.0, but at this page :
    >> http://www.microsoft.com/technet/scriptcenter/scripts/iis/default.mspx
    >>
    >> youll find sample scripts to do what
    >> you want to do in both versions.
    >>
    >>
    >>
    >> Juan T. Llibre
    >> ASP.NET MVP
    >> ===========
    >> "Mark" <> wrote in message
    >> news:...
    >> > Hello,
    >> > I'm trying to install an ASP.Net project using the command line (SDK
    >> > tools
    >> > & perhaps IIS Admin scripts?)
    >> >
    >> > Does anyone know of an automatic, command-line-driven way, to creat the
    >> > ASP.Net virtual directory, essentially mimicking whatever VS.Net does
    >> > when
    >> > it
    >> > creates a web project?
    >> >
    >> > Ideally it would be as simple as "CreateAspWebApp.bat virtualPath
    >> > PhysicalPath"
    >> >
    >> > I thought something like:
    >> > cd %windir%\Microsoft.NET\Framework\v1.1.4322
    >> > Aspnet_regiis -sn W3SVC/1/ROOT/SampleApp1
    >> >
    >> > would do it, but this requires that I first have a virtual directory.
    >> > So
    >> > then I run this first:
    >> > cd C:\Inetpub\AdminScripts
    >> > mkwebdir -c localhost -w "Default Web Site" -v
    >> > "SampleApp1","C:\Develop\SampleApp1\"
    >> >
    >> > The problem is that I still need to manually go into the IIS GUI
    >> > console,
    >> > go
    >> > to the web's property page, VirturalDirectory tab, and set its Execute
    >> > Permissions = "Scripts Only" (default is none) and click the "Create"
    >> > button
    >> > next to the Application Name textbox.
    >> >
    >> > Thanks,
    >> > Mark
    >> >

    >>
    >>
    >>
    Juan T. Llibre, Jan 11, 2005
    #4
  5. Hey Juan,
    Thanks for the link, I wouldn't have thought of that.
    I explored Directory Services, and it seems pretty involved... almost too
    involved.
    I was hoping that because the problem was so straight-forward, that IIS 5.1
    or the .Net SDK would just have a solution to it.

    Thanks,
    Mark

    "Juan T. Llibre" wrote:

    > In IIS 6, there's %SystemRoot%\System32\IIsVdir.vbs
    > and %SystemRoot%\System32\IIsWeb.vbs which let
    > you do it.
    >
    > I don't know if there's scripts for IIS 5.x which do that.
    >
    > You could try using System.DirectoryServices.
    > http://msdn.microsoft.com/library/d..._directory_using_system_directoryservices.asp
    >
    > There's an example in C# there.
    >
    >
    >
    >
    >
    > Juan T. Llibre
    > ASP.NET MVP
    > ===========
    > "Mark" <> wrote in message
    > news:...
    > > Hello Juan,
    > > Thanks for the post. I'm using IIS 5.1.
    > > I had checked out that sight before posting here. The closest script I can
    > > see on there is "Create an Application in a Web Directory". That script
    > > reads:
    > >
    > > strComputer = "LocalHost"
    > > Set objIIS = GetObject _
    > > ("IIS://" & strComputer &
    > > "/W3SVC/2142295254/root/aspnet_client_folder")
    > > objIIS.AppCreate(False)
    > >
    > > The problem is that I don't see where to set the physical directory of the
    > > application source code (such as "C:\inetpub\wwwroot\myApp1").
    > > Any advice?
    > > Thanks,
    > > Mark
    > >
    > > "Juan T. Llibre" wrote:
    > >
    > >> You didn't mention whether you're
    > >> using IIS 5.x of IIS 6.0, but at this page :
    > >> http://www.microsoft.com/technet/scriptcenter/scripts/iis/default.mspx
    > >>
    > >> youll find sample scripts to do what
    > >> you want to do in both versions.
    > >>
    > >>
    > >>
    > >> Juan T. Llibre
    > >> ASP.NET MVP
    > >> ===========
    > >> "Mark" <> wrote in message
    > >> news:...
    > >> > Hello,
    > >> > I'm trying to install an ASP.Net project using the command line (SDK
    > >> > tools
    > >> > & perhaps IIS Admin scripts?)
    > >> >
    > >> > Does anyone know of an automatic, command-line-driven way, to creat the
    > >> > ASP.Net virtual directory, essentially mimicking whatever VS.Net does
    > >> > when
    > >> > it
    > >> > creates a web project?
    > >> >
    > >> > Ideally it would be as simple as "CreateAspWebApp.bat virtualPath
    > >> > PhysicalPath"
    > >> >
    > >> > I thought something like:
    > >> > cd %windir%\Microsoft.NET\Framework\v1.1.4322
    > >> > Aspnet_regiis -sn W3SVC/1/ROOT/SampleApp1
    > >> >
    > >> > would do it, but this requires that I first have a virtual directory.
    > >> > So
    > >> > then I run this first:
    > >> > cd C:\Inetpub\AdminScripts
    > >> > mkwebdir -c localhost -w "Default Web Site" -v
    > >> > "SampleApp1","C:\Develop\SampleApp1\"
    > >> >
    > >> > The problem is that I still need to manually go into the IIS GUI
    > >> > console,
    > >> > go
    > >> > to the web's property page, VirturalDirectory tab, and set its Execute
    > >> > Permissions = "Scripts Only" (default is none) and click the "Create"
    > >> > button
    > >> > next to the Application Name textbox.
    > >> >
    > >> > Thanks,
    > >> > Mark
    > >> >
    > >>
    > >>
    > >>

    >
    >
    >
    =?Utf-8?B?TWFyaw==?=, Jan 11, 2005
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucas Cowald
    Replies:
    4
    Views:
    1,035
    Tohid
    Oct 23, 2003
  2. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Building Controls
    Replies:
    1
    Views:
    223
    Genich
    Oct 22, 2003
  3. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    1
    Views:
    191
    Oliver
    Oct 22, 2003
  4. Lucas Cowald

    RUN/execute a Command-Line command from an ASP page.

    Lucas Cowald, Oct 22, 2003, in forum: ASP .Net Mobile
    Replies:
    0
    Views:
    170
    Lucas Cowald
    Oct 22, 2003
  5. Headless Rider

    Control asp.net app from other asp.net app

    Headless Rider, Aug 18, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    90
    Headless Rider
    Aug 18, 2003
Loading...

Share This Page