For whatever reason, there are times when it would be convenient to know how to create a directory without having to go to the server to do it. This is just one of the things you can do with the File Scripting Object.
Nuts Own Code

Asp Directory

Nuts Web Search
Web Directory
Web Search

Nuts ASP Code
Functions
Scripts
Tutorials
Wizards
Fonts
Download Fonts
Download Dll Files
Dll Files
Relaxing Games
Online Games
Take Our Poll
Do you use .Net?
Yes
No
Not Yet
Dot What?
Really, Take It!
Get The Source
About Nuts4Asp
Privacy
Contact Us
Arts
Movies, Television, Music
Business
Jobs, Industries, Investing
Computers
Internet, Software, Hardware
Games
Video Games, RPGs, Gambling
Health
Fitness, Medicine, Alternative
Home
Family, Consumers, Cooking
Kids and Teens
Arts, School Time, Teen Life
News
Media, Newspapers, Weather
Reference
Maps, Education, Libraries
Regional
US, Canada, UK, Europe
Science
Biology, Psychology, Physics
Sports
Baseball, Soccer, Basketball
World
Deutsch, Español, Français, Italiano, Japanese, Nederlands, Polska, Svenska
Help build the largest human-edited directory of the web
Let's get straight to it:

<%
Dim myFSO
'this line creates an instance of the File Scripting Object named myFSO
SET myFSO = Server.CreateObject("Scripting.FileSystemObject")
'error handling here to make sure that things go smoothly
'if the folder does not exist 
If NOT myFSO.FolderExists("C:\Inetpub\wwwroot\myNewFolder") Then
'then we create it on this drive in the path we specify
myFSO.CreateFolder("C:\Inetpub\wwwroot\myNewFolder")
Else
'otherwise we tell the client it does so they don't get a nasty error
Response.Write "THIS FOLDER ALREADY EXISTS"
End If
'this line destroys the instance of the File Scripting Object named myFSO
SET myFSO = NOTHING
%>

Now you can do this with ease. Just make sure you have write permissions to the server in the directory you want to create the folder in.

To create a text file in the same way look at this tutorial.
To write to the file look at this tutorial.
To delete a file look at this tutorial.
To delete a folder look at this tutorial.

Bad or missing query parameters in request.

Copyright © 2001-2008 Nuts4Asp.com
All other names used are property or copyright of their respective owners.