Features
Ask DevGuru
ASP Resources
Find the Bug
Knowledge Base
Links
Tips of the Week
Tutorials
Products
dgCalendar
dgCharge New!
dgChart New!
dgFileUpload
dgReport New!
dgSort
dgTree
Site
Authoring
Coming Soon
DevGuru Resume
Link to Us
Merchandise
Sponsorships
Testimonials
What's New
Technologies
ADO 2.6
ASP
CSS2
HTML
JavaScript
Jet SQL
Transact-SQL Syntax
VBScript
WML
WMLScript
WSH
XML DOM
All Methods
File Object
METHOD: File.Copy
Implemented in version 3.0
object.
Copy
destination[, overwrite]
This method makes a copy of the selected file and saves it to the specified destination. The
overwrite
parameter is a Boolean value -
True
allows existing files with the same name as
destination
to be overwritten while
False
(the default) does not.
Note that after copying a file to a new location the
File
object still relates to the original file.
Code:
<%
dim filesys, demofile
set filesys = CreateObject ("Scripting.FileSystemObject")
set demofile = filesys.CreateTextFile ("c:\somefile.txt", true)
set demofile = filesys.GetFile("c:\somefile.txt")
demofile.Copy("c:\projects\someotherfile.txt")
%>
Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information