Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 2005 > Visual Basic 2005 Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Visual Basic 2005 Basics If you are new to Visual Basic programming with version 2005, this is the place to start your questions. For questions about the book: Beginning Visual Basic 2005 by Thearon Willis and Bryan Newsome, ISBN: 0-7645-7401-9 please, use this forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual Basic 2005 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 22nd, 2007, 11:54 PM
Registered User
Join Date: Sep 2007
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help with a copy code

I am writing a code to copy files to a new location and the way I have it set up is to browse t the source location and have that pasted into textbox1. Then use the folder browser to specify a new location and have that pasted into textbox2.
I would like to have a button that will then copy that the file specified to the location specified.

My issue is that I am not sure how to do this using the FileSystemObject. So far I have:

        Dim fso

        fso = CreateObject("File.Copy")

but I am not sure if i am going the right direction or not.
I'm not sure how to make the copy command read the file that is shown in textbox1 and copy it into the location in textbox2.

Any help would be greatly appreciated as I have a dead line for this that is coming up very quickly.

Thank you again,

Reply With Quote
  #2 (permalink)  
Old September 23rd, 2007, 03:04 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi Jimmie,

If you're using Visual Basic 2005, you shouldn't use the FileSystemObject. Instead, look at classes like System.IO.File, System.IO.Directory etc.


You'll find convenient methods like CreateDirectory, Move, Delete and so on that allow you to work with files and folders.

Hope this helps,


Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Code to copy a record from one table to another. lryckman Access VBA 7 July 29th, 2017 12:49 PM
Speed up code - looping and copy / paste vba_user Excel VBA 6 March 23rd, 2011 05:27 PM
Copy DataSet prasanta2expert ASP.NET 1.0 and 1.1 Professional 1 January 22nd, 2007 09:30 AM
MS Access, VBA code to copy recordset Ivan Classic ASP Databases 1 November 1st, 2003 05:52 PM
code to copy a query recordset to a file Ivan Access VBA 9 October 31st, 2003 06:50 PM

All times are GMT -4. The time now is 04:53 AM.

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