UNC Path Names 
Author Message
 UNC Path Names

Hello,

I have a script that I would like to use a UNC pathname to access shares on
other machines. What I am doing is coping files to and from the shares on
the othermachines through an ASP page. If I go to that machine and map a
drive to the share or try to simulate it on the local machine it works fine
but as soon as I try to use the UNC pathname I get the error below. I am
using basic authentication on the web site so the permission error is not
there but I still get this error.

Microsoft VBScript runtime  error '800a0034'

Bad file name or number

/filecopy.asp, line 89

85:  origfile = "\\192.168.1.122\inetpub\wwwroot\xxxxxx" & xstr
86:  destfile = NewDir2
87: 'response.write("xstr = " & xstr & "<br>" & "origfile = " & origfile &
"<br>")
88:  response.write(origfile & " -> " & destfile & "<br>")
89:  fso.CopyFile origfile, destfile

Any ideas would help.

Thanks in advance,
Russ



Sun, 28 Jul 2002 03:00:00 GMT  
 UNC Path Names
I've been told that that is a bug in ASP.



Quote:
> Hello,

> I have a script that I would like to use a UNC pathname to access shares
on
> other machines. What I am doing is coping files to and from the shares on
> the othermachines through an ASP page. If I go to that machine and map a
> drive to the share or try to simulate it on the local machine it works
fine
> but as soon as I try to use the UNC pathname I get the error below. I am
> using basic authentication on the web site so the permission error is not
> there but I still get this error.

> Microsoft VBScript runtime  error '800a0034'

> Bad file name or number

> /filecopy.asp, line 89

> 85:  origfile = "\\192.168.1.122\inetpub\wwwroot\xxxxxx" & xstr
> 86:  destfile = NewDir2
> 87: 'response.write("xstr = " & xstr & "<br>" & "origfile = " & origfile &
> "<br>")
> 88:  response.write(origfile & " -> " & destfile & "<br>")
> 89:  fso.CopyFile origfile, destfile

> Any ideas would help.

> Thanks in advance,
> Russ



Sun, 28 Jul 2002 03:00:00 GMT  
 UNC Path Names

I didn't try with ASP, but FSO does support UNC names with ip addresses for server name.

Try adding this to your debugging output:

response.write(fso.FileExists(origfile) & "<br>")

And it may be an obvious question, but is the share name actually "inetpub"?

--
Michael Harris
MVP - Windows Script

  Hello,

  I have a script that I would like to use a UNC pathname to access shares on
  other machines. What I am doing is coping files to and from the shares on
  the othermachines through an ASP page. If I go to that machine and map a
  drive to the share or try to simulate it on the local machine it works fine
  but as soon as I try to use the UNC pathname I get the error below. I am
  using basic authentication on the web site so the permission error is not
  there but I still get this error.

  Microsoft VBScript runtime  error '800a0034'

  Bad file name or number

  /filecopy.asp, line 89

  85:  origfile = "\\192.168.1.122\inetpub\wwwroot\xxxxxx" & xstr
  86:  destfile = NewDir2
  87: 'response.write("xstr = " & xstr & "<br>" & "origfile = " & origfile &
  "<br>")
  88:  response.write(origfile & " -> " & destfile & "<br>")
  89:  fso.CopyFile origfile, destfile

  Any ideas would help.

  Thanks in advance,
  Russ



Sun, 28 Jul 2002 03:00:00 GMT  
 UNC Path Names
http://www.aspfaq.com/faq/faqShow.asp?fid=55


Mon, 29 Jul 2002 03:00:00 GMT  
 UNC Path Names

Adrian,

That applies only for Anonymous access to the site.  Chaos explicitly said that Basic Authentication was being used.  In any case, the error would be 70 - "Permission denied", not 52 - "Bad file name or number".

--
Michael Harris
MVP - Windows Script

  http://www.aspfaq.com/faq/faqShow.asp?fid=55



Mon, 29 Jul 2002 03:00:00 GMT  
 UNC Path Names

What version of the Scripting Runtime Library are you using (scrrun.dll)?

--
Michael Harris
MVP - Windows Script

  Hello,

  I have a script that I would like to use a UNC pathname to access shares on
  other machines. What I am doing is coping files to and from the shares on
  the othermachines through an ASP page. If I go to that machine and map a
  drive to the share or try to simulate it on the local machine it works fine
  but as soon as I try to use the UNC pathname I get the error below. I am
  using basic authentication on the web site so the permission error is not
  there but I still get this error.

  Microsoft VBScript runtime  error '800a0034'

  Bad file name or number

  /filecopy.asp, line 89

  85:  origfile = "\\192.168.1.122\inetpub\wwwroot\xxxxxx" & xstr
  86:  destfile = NewDir2
  87: 'response.write("xstr = " & xstr & "<br>" & "origfile = " & origfile &
  "<br>")
  88:  response.write(origfile & " -> " & destfile & "<br>")
  89:  fso.CopyFile origfile, destfile

  Any ideas would help.

  Thanks in advance,
  Russ



Mon, 29 Jul 2002 03:00:00 GMT  
 UNC Path Names

What?  You think I *read* the post? :)  Too much time on newsgroups, it was a gut reaction response when I saw UNC.

Besides, isn't it CopyFile and not FileCopy?

http://msdn.microsoft.com/scripting/VBScript/doc/vsmthCopyFile.htm



Tue, 30 Jul 2002 03:00:00 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. How to get UNC path names?

2. How to get UNC path names?

3. returning full physical path name of a remote UNC share

4. Getting UNC Network Path Name

5. unc path / ip address / internet name ???

6. UNC Name Need to code a network Path

7. Converting logical paths to UNC paths

8. Converting logical paths to UNC paths

9. Converting local path to UNC path?

10. Local path vs UNC Path

11. Help converting UNC paths to physical paths.

12. How transform path into unc-path ?

 

 
Powered by phpBB® Forum Software