473,396 Members | 1,891 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,396 software developers and data experts.

Creating Virtual Directory from script

I have a function that creates a new Virtual Directory. I would like
to alter this function so that it sets a few properties on this new
virtual directory, namely I want to make it so "Execute Permissions"
are set to "Scripts Only" (currently this defaults to "None". Also I
want to make the new virtual directory an application (as if I created
the virtual directory manually and clicked the "Create Application"
button on the vd properties.

Thanks,
-J

Public Function CreateVirtualDir(aPath As String, Name As String,
ServerName As String) As Boolean
Dim Root
Dim rtn As Boolean
Dim Dir

rtn = True
On Error Resume Next

Set Root = GetObject("IIS://" & ServerName & "/W3SVC/1/ROOT")

Set Dir = Root.Create("IIsWebVirtualDir", Name)
Dir.Path = aPath
Dir.AccessRead = True
Dir.AccessWrite = True
Dir.AppCreate = True
Dir.EnableDirBrowsing = False

Dir.AppFriendlyName = Name
Dir.SetInfo

Set Dir = Nothing
Set Root = Nothing

If (Err.Number <> 0) Then

'MsgBox "Web Server doesn't exist"
rtn = False
End If
End Function
Jul 19 '05 #1
0 1603

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

Similar topics

6
by: sharma | last post by:
Hi all, I have a site called www.example.com. I would like to offer free hoting to the people and offer a site with their username like this. www.username.example.com. Please can any one here...
2
by: Jacky Luk | last post by:
Hi all, If I need to make a C# application, do I need to set up a virtual dir such as inetroot on the Harddisks. How do I set up such thingy? Thanks Jack
2
by: Jeffry van de Vuurst | last post by:
Hi, (sorry for the crosspost, I wasn't sure which was the best place to put this). I was just thinking about something and wondered if any of you has some ideas about this. I'm using the...
5
by: Leszek | last post by:
Hello, Could anybody explain what's a difference between a virtual directory and an application root under IIS? I'm a little bit confused. This is mu problem: Let's assume the following...
7
by: Jaydeep | last post by:
Hi, Anybody knows how to create virtual directory programmatically under root directory ofcourse from code-behind. I am developing web-based application where I need to create a folder and making...
6
by: Saar Carmi | last post by:
Hi How can I get the application's virtual directory from the Application_Start method in Global.asax ? Keep in mind there is no request/response object available yet in this stage. Thanks...
5
by: Sam777 | last post by:
I was under the impression that creating the app_offline.htm file at the root of the webapp would cause all handles to be closed so that the app could be removed. Unfortunately, this isn't the...
1
by: fredfrog22 | last post by:
The following is an extract from a C# console application that creates a Virtual Directory on IIS 5 or 6. This code works on XP, Windows 2003 Server, Windows 2000. It does not work on Windows...
1
by: rogersmithiii | last post by:
We have a production web site - www.thesite.com - laid out as follows on IIS 6: d:\Inetpub\wwwroot\default.asp There are lots of subdirectories inside of WWWROOT including a cgi-bin directory...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.