Creating folders using asp/fso on pws

Posted on 2003-02-20
Medium Priority
Last Modified: 2013-12-25
I tried to dynamically create a folder on my home workstation using the code below. Not only does it not create the folder, but it seems to sit in a loop. I do have the scrrun.dll on my machine which is what Microsoft says contains the fso. I also tried this same code at work (IIS 5.0 Server) and it worked fine. Why not a home??

Set fso = CreateObject("Scripting.FileSystemObject")
folder = Server.mapPath("/albums/images/newFolder")
if  not fso.FolderExists(folder) then
end if
Set fso = Nothing

Thank you

Question by:gutierrez13
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 18

Accepted Solution

mgfranz earned 192 total points
ID: 8031080
"sits in a loop"?  how do you know?  Does the folder get created?  I'm sure there is more to your script than this... You said PWS is the driving motor behind the script?

Post your code.  And try this;

Set fso = Server.CreateObject("Scripting.FileSystemObject")

Update to ASP 3.0 too.
LVL 10

Assisted Solution

dij8 earned 188 total points
ID: 8148764
You will need permissions to create files or folders.  If you are on an NT based machine then this will have to be set.  You need to give write permissions to the IUSR_ComputerName account and/or IWAM_ComputerName.  These are the Internet accounts.  Assuming the "albums" folder already exists then this is the folder that will need to have the permissions applied to.

I am assuming that you are running the page through a server on your machine.  You will NOT be able to create folders on the client machine when the server is a different one.

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Because your company can’t afford for you to make SEO mistakes, you’ll want to ensure you’re taking the right steps each and every time you post a new piece of content. This list of optimization do’s and don’ts can help you become an SEO wizard.
This article was originally published on Monitis Blog, you can check it here . Today it’s fairly well known that high-performing websites and applications bring in more visitors, higher SEO, and ultimately more sales. By the same token, downtime…
The viewer will learn how to dynamically set the form action using jQuery.
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
Suggested Courses

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question