469,951 Members | 2,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,951 developers. It's quick & easy.

Problems with simple FileSystemObject code

MDJ
Hi, haven't been on here for a while but used to help out with ASP queries,
hoping for a bit of guidance myself!

I've stripped down the code i'm having trouble with to the following,
basically I just want the code to duplicate a template file, i.e create a
new file from a template, when I run the code below on Windows 2000
Professional (IIS 5) the page never finishes executing and no file is
created, haven't done much with FileSystemObject before so don't know what's
going on. Can anyone point me in the right direction?

strTemplate =
Server.MapPath("..\environmental-health-issues\template.asp")
strNewFile = Server.MapPath("..\environmental-health-issues\newfile.asp")
Set FSO = Server.CreateObject("Scripting.FileSystemObject")
Set F1 = FSO.GetFile(strTemplate)
F1.Copy(strNewFile)
Set F1 = nothing
Set FSO = nothing
Many Thanks,

Martin
Jul 19 '05 #1
3 1697
MDJ wrote:
Hi, haven't been on here for a while but used to help out with ASP
queries, hoping for a bit of guidance myself!

I've stripped down the code i'm having trouble with to the following,
basically I just want the code to duplicate a template file, i.e
create a new file from a template, when I run the code below on
Windows 2000 Professional (IIS 5) the page never finishes executing
and no file is created, haven't done much with FileSystemObject
before so don't know what's going on. Can anyone point me in the
right direction?

strTemplate =
Server.MapPath("..\environmental-health-issues\template.asp")
strNewFile =
Server.MapPath("..\environmental-health-issues\newfile.asp") Set
FSO = Server.CreateObject("Scripting.FileSystemObject") Set F1 =
FSO.GetFile(strTemplate) F1.Copy(strNewFile)
Set F1 = nothing
Set FSO = nothing
Many Thanks,

Martin


http://www.aspfaq.com/show.asp?id=2180

Bob Barrows

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 19 '05 #2
Hi Martin,

Thanks for posting in the group.

I noticed that you posted it also in
microsoft.public.inetserver.asp.components group. If you have time, you
could check my reply there.

If you have any more concerns, please feel free to post there and I will
follow up there.

Happy holidays.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Jul 19 '05 #3
>
http://www.aspfaq.com/show.asp?id=2180

Bob Barrows


Thanks Bob, much appreciated, that never occurred to m.

Martin
Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by John Dewbert | last post: by
8 posts views Thread by Pat | last post: by
4 posts views Thread by Stimp | last post: by
1 post views Thread by G Gerard | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.