codetoad.com
Home||ASP|ASP.Net|C++/C#|DHTML|HTML|Java|Javascript|Perl|VB|XML||CodeToadPlus!||Forums||RAM
Search Site:
Search Forums:
UNC Path or Mapped Drive with FSO DJGray at 20:46 on Monday, April 05, 2004

VERY new to asp...

I need to walk a folder that is on a company standard mapped drive "Z:" drive. I have tried to do this with UNC and the mapped drive name as follows:

' Create an instance of the FileSystemObject
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFileObject.GetFolder("\\machinename\pathname")



as well as this way:

' Create an instance of the FileSystemObject
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFileObject.GetFolder("z:\myfolderpath")


and even tried passing it as a variable defined each way:

' Create an instance of the FileSystemObject
Set MyFileObject=Server.CreateObject("Scripting.FileSystemObject")
' Create Folder Object
Set MyFolder=MyFileObject.GetFolder(sDocumentPath)


In evey case, I get an error message pointing to the line with the path information on it stating that the path is "not found."

Does ASP not support UNC paths or mapped drives?



Re: UNC Path or Mapped Drive with FSO Troy Wolf at 21:07 on Monday, April 05, 2004

I do not see any errors in your code, and yes, the FileSystemObject does allow both UNC and Drive Letter mapping. Your problem is probably a user privilege issue. You probably need to give the IUSR account privileges to the folder you want to work with.

By default the account used by IIS for anonymous access is IUSR_COMPUTERNAME. So if your computer is named "FRED", then the account would be IUSR_FRED. Right click the folder, select Security, and add the IUSR account.
Troy Wolf: site expert
SnippetEdit Website Editor


Re: UNC Path or Mapped Drive with FSO DJGray at 20:21 on Tuesday, April 06, 2004

Thanks Troy. I'll do as you said and see what happens. It is good to know that the support for UNC is there so at least there IS a solution. I'll wrestle the tiger till I win! ;-)

Re: UNC Path or Mapped Drive with FSO kevp75 at 21:30 on Monday, May 16, 2005

I am having the same problem, except I am not on a domain, but rather a workgroup (I only have 2 PC's)

I have tried everything, including adding the IUSR_machinename to my other machine. As well as installing IIS on it...still no dice.

Re: UNC Path or Mapped Drive with FSO JulianaCR at 17:51 on Tuesday, July 12, 2005

Where you able to solve this issue. I'm having the same problem.



Re: UNC Path or Mapped Drive with FSO kevp75 at 18:26 on Tuesday, July 12, 2005

Unfortunately I have not, however I have been searching around for a solution.

Basically all I have been able to come up is the computers need to be in a domain, and the IUSR_machinename of the IIS server needs to be spoofed as a user on the networked machine.

I am not able to try this out, as I only have a 2 PC network, but I would be very interested if anyone else has been able to do this sucessfully.


Re: UNC Path or Mapped Drive with FSO Luke at 07:12 on Wednesday, July 27, 2005

I think the only way to get around this in your situation is called something like credential matching.
The theory goes something like:

Setup identical users on both machines that have exactly the same username and password.

In IIS directory security tab of your website manually set the Anonymous access account to this new user.

Grant the user of the same name on the other machine access to all the necessary folders.

I've haven't tried this myself but I've read something about it before.
Sorry I couldn't help more but hopefully this will give you some ideas.








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
jordan breds
How do you programatically open a file in c# to append?
C++ SMS SDK for Visual Studio
タイトリスト AP2アイアン 712�情報
Re: Moncler Jackets Outlet For Winter Coats At www.winterjackets4moncler.com
Re: Replace
SMS from Perl using HTTP request
Re: What do you mean by ASP.NET MVC Execution Process?
Re: Ô‡´ò¥¯¥é¥Ö¤Ï ¥Æ©`¥é©`¥á¥¤¥É£ò£±£±¥¢¥¤¥¢¥ó ¤Î£··¬ ¤Ç¤¹


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


Copyright codetoad.com 2001-2012