473,396 Members | 1,891 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1801
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.