Wrox Programmer Forums
|
ASP Pro Code Clinic As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Pro Code Clinic section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 8th, 2003, 12:20 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy over File System Object

Hi,

I want to copy a file from a Folder to another Folder using the File System Object in ASP, but I just don't know how to do that. May someone help me with that?
I tried with no success:
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
Set objDriveC = objFSO.GetDrive("C:")
Set objRoot = objDriveC.RootFolder
Set objFolder = objFSO.GetFolder("C:\inetpub\wwwroot\CCA")
For Each objFile in objFolder.Files
    If objFile.Name = "meu.asp" Then objFile.Copy (C:\inetpub\wwwroot\CCA\2\",True)

Next

What else should I do?

Thanks for the Help.

 
Old July 8th, 2003, 02:07 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Paleo,

Check out the MSDN documentation for the CopyFile method at:

http://msdn.microsoft.com/library/de...thCopyFile.asp

If you click Reference at the top of the page you'll get into the reference section for the FileSystemObject, with lots of documentation and code examples.

HtH

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old July 8th, 2003, 03:27 PM
Registered User
 
Join Date: Jul 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Imar, this helped me.






Similar Threads
Thread Thread Starter Forum Replies Last Post
File System Object question fogofogo Classic ASP Basics 1 December 8th, 2005 04:14 PM
File System Object kumar_rajeshk Pro VB 6 7 April 28th, 2004 01:35 AM
File System Object Permissions kilika Classic ASP Basics 2 August 6th, 2003 09:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.