Create, Delete virtual directory with ASP

B

banon

I am trying to write code to create and delete a virtual directory with ASP 3.
If it is not possible, then how could I do the same with a physical folder.
any help is appreciated.

Thanks in advance
 
S

Steven Burn

Take a look at FSO

Psuedo code (works in VB, not sure bout ASP).

Dim FSO
Dim Fldr
Dim strPath
strPath = "new_folder"
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.CreateFolder(strPath)
Set Fldr = Nothing
Set strPath = Nothing
Set FSO = Nothing

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 
B

banon

Actually, you are not wrong, the only difference is the path
information and delimiters.
Thanks for the help.
Now if only I can get it to work on response of the button.
I am posting a form which contains the name of the new folder to a
page with the code to create a folder with the name entered.
The usual:
<%
If Request.Form("blah") <> "" Then
DoSub
End If
%>

isn't working.
Any suggestions, or explanations?
 
S

Steven Burn

Try the following;

<%
If Request.Form("blah") <> "" Then
DoCreateFolder "MyFolder"
End If

Public Function DoCreateFolder(strFolder As String)
Dim FSO
Dim Fldr
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set Fldr = FSO.CreateFolder(strFolder)
Set Fldr = Nothing
Set FSO = Nothing
End Function

%>

--

Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,140
Messages
2,570,810
Members
47,357
Latest member
sitele8746

Latest Threads

Top