473,691 Members | 3,177 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with simple FileSystemObjec t 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 FileSystemObjec t before so don't know what's
going on. Can anyone point me in the right direction?

strTemplate =
Server.MapPath( "..\environment al-health-issues\template .asp")
strNewFile = Server.MapPath( "..\environment al-health-issues\newfile. asp")
Set FSO = Server.CreateOb ject("Scripting .FileSystemObje ct")
Set F1 = FSO.GetFile(str Template)
F1.Copy(strNewF ile)
Set F1 = nothing
Set FSO = nothing
Many Thanks,

Martin
Jul 19 '05 #1
3 1819
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 FileSystemObjec t
before so don't know what's going on. Can anyone point me in the
right direction?

strTemplate =
Server.MapPath( "..\environment al-health-issues\template .asp")
strNewFile =
Server.MapPath( "..\environment al-health-issues\newfile. asp") Set
FSO = Server.CreateOb ject("Scripting .FileSystemObje ct") Set F1 =
FSO.GetFile(str Template) F1.Copy(strNewF ile)
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.publi c.inetserver.as p.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
4058
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
19625
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 directories.
3
7170
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, what should be changed ? OS : W2KP/IIS CPU PII 350 MHz Mem >500 MB
4
3653
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 have tried re installing IIS which has not made any difference. The script gets to the line annotated "'This is where it breaks" and at this line the script simply hangs with no error message at all. I would guess this is some kind of config...
2
1300
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 following using ASP? // IN: sUsername
9
3916
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', 'Scripting', 'Scripting.FileSystemObject', and a few others However, when I try to create the fso object I keep receiving an error. 'ActiveX component can't create object: 'Scripting.FileSystemObject'
4
1285
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 question which may have some relevance to asp.net users. I am trying to run an asp page on my local Windows 2000 machine which creates a folder in the root directory of my site, but when I run the page it simply hangs when it gets to the...
1
17126
by: G Gerard | last post by:
Hello I am using the FileSystemObject to copy files on a computer Dim MyObject as Object
12
5914
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 help on this one and i tried to do the same thing with the "movefile" but it never worked as you can see the "filesystemobject" is hard to accomplish for me because this "Movefolder" event falls in this category the code i have i have used for the...
0
8598
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8531
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8951
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8786
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8793
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6457
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2225
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.