Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > How to create a folder from a UNC path

Reply
Thread Tools

How to create a folder from a UNC path

 
 
MacMan0295
Guest
Posts: n/a
 
      12-30-2008
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.
 
Reply With Quote
 
 
 
 
Daniel Crichton
Guest
Posts: n/a
 
      01-05-2009
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
> 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.



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.

--
Dan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
New Folder in a UNC Path Chris ASP .Net 0 01-06-2009 03:46 PM
Perl - Parse UNC Path in a string variable Kevin Joseph Perl 5 08-13-2004 11:56 AM
Retrieving UNC Path of Mapped Drives on Client Machine =?Utf-8?B?RGVhbiBNY0NhcnRlbg==?= ASP .Net 7 05-20-2004 02:41 PM
AppDomain.CurrentDomain.BaseDirectory in ASP.Net for UNC path. George Nevsky ASP .Net 1 05-16-2004 04:47 AM



Advertisments