Problems with simple FileSystemObject code

M

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
 
B

Bob Barrows

MDJ said:
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
 
Y

Yan-Hong Huang[MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top