Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ASP / General ASP Topics / January 2009



Tip: Looking for answers? Try searching our database.

How to create a folder from a UNC path

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MacMan0295 - 30 Dec 2008 15:14 GMT
I am trying to create a folder on a fileserver from an ASP page using
VBScript.  The VBScript I am using work fine, but when I try to change it to
work on the asp page it fails.  If I try to use "i:\folder" it says drive not
ready.  If I try to use "\\server\folder" it says permission denied.  Here is
what I got:

Set objFSO = CreateObject("Scripting.FileSystemObject")
fldPath = "\\server\folder\" & grpName & "\" & fldName
Response.Write(fldPath  & "<br>")
If objFSO.FolderExists(fldPath) = True Then
    Response.Write "Folder " & fldPath & " Exists!"
Else
    Response.Write "Creating folder... " & fldPath
    Set objFolder = objFSO.CreateFolder(fldPath)
    SetACLs fldPath,grpName,fldName
End If

Any help is appreciated. Thank you.
Daniel Crichton - 05 Jan 2009 10:55 GMT
MacMan0295 wrote  on Tue, 30 Dec 2008 07:14:01 -0800:

> I am trying to create a folder on a fileserver from an ASP page using
> VBScript.  The VBScript I am using work fine, but when I try to change
> it to  work on the asp page it fails.  If I try to use "i:\folder" it
> says drive not  ready.  If I try to use "\\server\folder" it says
> permission denied.  Here is  what I got:

> Set objFSO = CreateObject("Scripting.FileSystemObject")
> fldPath = "\\server\folder\" & grpName & "\" & fldName
[quoted text clipped - 6 lines]
> SetACLs fldPath,grpName,fldName
> End If

> Any help is appreciated. Thank you.

The "Permission Denied" means that the user account your ASP is running
under (which account this is depends on whether it's using anonymous or an
authenticated account) doesn't have permission to write (or read, depending
on which line you get the error) to the UNC share. You need to look into
setting the appropriate permissions.

As to using "i:\folder", drive letter mappings are on a per-user basis so if
you set up a mapping under an account you logged into on Windows then other
user accounts (such as the one used to run IIS which is in turn running ASP)
cannot see the i: mapping. You could go into the registry and set up the
mapping for the appropriate user, but you're better off sticking with UNC
paths.

Signature

Dan

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.