473,383 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Creating web applications NOT via IIS console

is there any way to promote programatically a directory
(located within inetpub directory subtree) to web application?

Also I would like programatically add new IASPI mapping
(for some custom file extension to particular DLL)
for this newly created web application.
Thanks for help
Michał Januszczyk

Nov 18 '05 #1
1 2112
Yes.
You should use ADSI
It's easy to use from VBS.
Here is the sample i wrote for our application.
It's installing an applicatio on IIS in a vritual folder /English/club
Sub CreateIISApplication()
On Error Resume Next
Err.Clear
Dim sWorkingFolder, sWWWRoot
Set objIIS = GetObject("IIS://Localhost/W3SVC/1/Root")
sWWWRoot = objIIS.PAth

sWorkingFolder = Left(WScript.ScriptFullName, Len(WScript.ScriptFullName) - 12 )
WScript.Echo "Copying ASP files.PLease wait."
Set objFileSystem = WScript.CreateObject("Scripting.FileSystemObject")
objFileSystem.CopyFolder sWorkingFolder & "\InstallFiles\IIS Files", sWWWRoot, true

objIIS.GetInfo
Set objDir = objIIS.GetObject("IIsWebDirectory", "English")
if Err.Number <> 0 Then
Err.Clear
Set objDir = objIIS.Create("IIsWebDirectory", "English")
End if
objDir.AccessScript = true
objDir.SetInfo
objDir.GetInfo

Set objDir = objDir.GetObject("IIsWebDirectory", "Club")
if( Err.Number <> 0 ) Then
Err.Clear
Set objDir = objIIS.Create("IIsWebDirectory", "Club")
End if
objDir.AppCreate true
objDir.AccessScript = true
objDir.SetInfo

Set objApp = GetObject("IIS://Localhost/W3SVC/1/Root/English/Club")
Set objDir = objApp.GetObject("IIsWebDirectory", "Admin")
if( Err.Number <> 0 ) Then
Err.Clear
Set objDir = objApp.Create("IIsWebDirectory", "Admin")
End if
objDir.ContentIndexed = False
objDir.AuthAnonymous = False
objDir.SetInfo
On Error goto 0
Set objDir = objApp.GetObject("IIsWebDirectory", "Members")
if( Err.Number <> 0 ) Then
Err.Clear
Set objDir = objApp.Create("IIsWebDirectory", "Members")
End if
objDir.ContentIndexed = False
objDir.AccessSSL = True
objDir.SetInfo

End Sub
George
My Site - Body Jewelry
"Michał Januszczyk" <Michal Ja********@discussions.microsoft.com> wrote in message news:F4**********************************@microsof t.com...
is there any way to promote programatically a directory
(located within inetpub directory subtree) to web application?

Also I would like programatically add new IASPI mapping
(for some custom file extension to particular DLL)
for this newly created web application.
Thanks for help
Michał Januszczyk

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: H | last post by:
There are a number of dos applications written in borland C++ 4.51. I want to convert these into .net; while maintaining the ability to run the applications on dos machines.
0
by: Bryan Olson | last post by:
New and improved! Love Python's stack-tracing error messages, but hate the way GUI applications throw the messages away and crash silently? Here's a module to show Python error messages that...
4
by: Raed Sawalha | last post by:
I'm trying to create Element as following name MyElement:InitialName XmlElement elem = doc.CreateElement("MyElement:InitialName"); when generate the XML the tag is truncated as ONLY...
3
by: Birthday | last post by:
Hi, I have started to learn C# nowadays and find some ebooks on the structure and the syntax of the c# language. All the examples in the ebooks that I've found are all about console...
15
by: Carlos Lozano | last post by:
Hi, What is the right way to create an OCX COM component. The component is already registerred, but can't create an instance. I am using the reference to the interop module created. If I use...
7
by: Nathan Sokalski | last post by:
I am having a problem saving an image with the same name it originally had. I have two similar versions of my code, one in which I close the FileStream used to open the original image before saving,...
9
by: Rotzooi | last post by:
Hi, I have a VB.NET Service application that's running fine under the Local System account. But for configuration purposes I don't want to be dependent on modifying the registry manually or...
1
by: itmanager | last post by:
Is there a way, using the CreateProcess/CreateProcessAsUser api's to launch an application with it windows hidden upon startup?
2
by: dan.goyette | last post by:
Hello. I'm new to C#. I've searched this group, and tried other google searches, and have not found an answer to this question already. The question is pretty simple. I like the Console.WriteLine...
0
by: TheOne | last post by:
I'm reading Petzold's "APPLICATIONS=CODE+MARKUP". In chapter 1, sample csharp code shows how an application inherited class overrides OnSessionEnding handler. Code looks like following ///...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.