Problem using FileSystemObject and UNC paths 
Author Message
 Problem using FileSystemObject and UNC paths

I am trying to use JScript and the FileSystemObject to iterate through
folders on my network.  The problem is that functions like GetFolder fail
when I give them a UNC path.  The same code succeeds if I replace the UNC
path with actual local on the server (assuming the UNC path referred to a
drive actually on the server).

For example:

There is a file on my server at d:\public\readme.txt.
d:\public is shared on the network as \\comp1\public.

fso.GetFile("d:\\public\\readme.txt"); // works fine
fso.GetFile("\\\\comp1\\public\\readme.txt"); // doesn't work

Ideas?



Mon, 11 Feb 2002 03:00:00 GMT  
 Problem using FileSystemObject and UNC paths

Quote:
> I am trying to use JScript and the FileSystemObject to iterate through
> folders on my network.  The problem is that functions like GetFolder fail
> when I give them a UNC path.  The same code succeeds if I replace the UNC
> path with actual local on the server (assuming the UNC path referred to a
> drive actually on the server).

Hi Aaron,

Does the IUSR_MACHINE account have access to the share? It needs an account
on the computer, I think.

http://www.deja.com/ will give you references to answers to this (it comes
up periodically, but I can't remember the exact answer).

Peter

--
Peter J. Torr - Microsoft Windows Script Program Manager

Please do not e-mail me with questions - post them to this
newsgroup instead. Thankyou!



Mon, 11 Feb 2002 03:00:00 GMT  
 Problem using FileSystemObject and UNC paths
To expand on what Peter said...

If IUSR_machinename doesn't have access, then you'll need to use Basic
Authentication so IIS will have credentials with which to respond to the NT
challenge.

--
Michael Harris





| > I am trying to use JScript and the FileSystemObject to iterate through
| > folders on my network.  The problem is that functions like GetFolder fail
| > when I give them a UNC path.  The same code succeeds if I replace the UNC
| > path with actual local on the server (assuming the UNC path referred to a
| > drive actually on the server).
|
| Hi Aaron,
|
| Does the IUSR_MACHINE account have access to the share? It needs an account
| on the computer, I think.
|
| http://www.deja.com/ will give you references to answers to this (it comes
| up periodically, but I can't remember the exact answer).
|
| Peter
|
| --
| Peter J. Torr - Microsoft Windows Script Program Manager

| Please do not e-mail me with questions - post them to this
| newsgroup instead. Thankyou!
|
|



Mon, 11 Feb 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Using FileSystemObject with a UNC

2. Converting logical paths to UNC paths

3. Converting logical paths to UNC paths

4. Converting local path to UNC path?

5. UNC Path and the local System Account

6. Filesystem object UNC Path Error

7. bug vbs 5.6 FSO with UNC path

8. UNC Path Names

9. UNC Path

10. Copy file to UNC path?

11. Detect if a path is a UNC

 

 
Powered by phpBB® Forum Software