I need to write a file to the disk
In my ASP scripts I use this
Set fso = CreateObject("Scripting.FileSystemObject")
Set ts = fso.CreateTextFile(path1 &file_name , True)
ts.WriteLine(eps1)
ts.Close
It works fine within same (local) HD(s)
path2="c:\vahan\"
.
It returns an error when target drive is on another PC in the LAN:
Microsoft VBScript runtime (0x800A004C)
Path not found
I tried both ways - by computer name like
path2="\\Braun2\c:\vahan\"
or by network drive like
path2="h:\vahan\"
neither works...
Is it possible to write to the (local) network drive?
Thanks for advices,
Vahan
McKirahan - 19 Mar 2005 00:44 GMT
> I need to write a file to the disk
> In my ASP scripts I use this
[quoted text clipped - 25 lines]
> Thanks for advices,
> Vahan
First, change
Set ts = fso.CreateTextFile(path1 &file_name , True)
to
Set ts = fso.CreateTextFile(path1 &file_name , ForWriting, True)
where
Const ForWriting = 2
Then use
Server.MapPath(file_name)
instead of
path1 &file_name
as the path must be relative to where your Web page is.
Or you can use a virtual directory to point to another folder.
Marius Strumyla - 06 Apr 2005 22:30 GMT
See kb article 197964
http://support.microsoft.com/default.aspx?scid=kb;en-us;197964
Hope this helps
--
i5mast