472,371 Members | 1,530 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,371 software developers and data experts.

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 1752
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Dewbert | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Hello, I have trouble passing a folder object (from a FileSystemObject) to a sub procedure. Consider the following code: ...
8
by: Pat | last post by:
Hi, I'm pulling my hair out here over this one... The following line of code: Msgbox Dir("c:\test\", vbDirectory) Is returning the names of files in the directory instead of other...
3
by: PB4FUN | last post by:
If I comment #2 to #5 no problems. If I uncomment #2, #4 and #5 the page hangs. Even did not reach the point to uncomment #3 So, whats wrong. Do i have to alter some serversettings, and if so,...
4
by: c | last post by:
I have the following very simple script which works on my desktop (XP-PRO & IIS5.1) but does not work on my laptop with the same config. It also works on other configurations without a problem. I...
2
by: nix | last post by:
Hi I want to create a simple user validation script without using a database. Let's say I have a text file in my asp folder with a list of valid usernames. How can i do something like the...
9
by: kermit | last post by:
I keep seeing that you can use the FileSystemObject in either VB script, or Javascript on an aspx page. I added a refrence to the scrrun.dll I added importing namespaces for 'System.Object',...
4
by: Stimp | last post by:
This is a query to do with classic ASP (written through vbscript). I apologise in advance to posting to an ASP.NET forum, but my newsserver doesn't have any others listed... plus it's a permissions...
1
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
12
lee123
by: lee123 | last post by:
why is this so hard to do. i have alot of books that have exaples of how to do these things but when i try the exaples they never work i have a previous post on "copying files" some of the other guys...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
BLUEPANDA
by: BLUEPANDA | last post by:
At BluePanda Dev, we're passionate about building high-quality software and sharing our knowledge with the community. That's why we've created a SaaS starter kit that's not only easy to use but also...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
2
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.