Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 25th, 2003, 02:52 PM
Authorized User
 
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Move a file via code

Is it possible to move a file from one location on a HDD to another using VB?

For example:
c:\this\that\theother\a.txt
c:\this\that\a.txt



Regards

Russ (Programing on L plates..!)
__________________
Regards

Russ (Programing on L plates..!)
Reply With Quote
  #2 (permalink)  
Old June 25th, 2003, 02:56 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: McPherson, Kansas, USA.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

The simplist way is probably to us NAME, AS

Name "c:\this\that\theother\a.txt" As "c:\this\that\a.txt"

I think that is correct?

You can also use the File System Objects method FileCopy to learn more about it read your help files for File System Object.

Hope this helps.

Larry Asher
Reply With Quote
  #3 (permalink)  
Old June 26th, 2003, 01:04 PM
Authorized User
 
Join Date: Jun 2003
Location: London, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Larry, I'll give it a go, and do some reading on FSO. Its difficult when you first start out to know what to search for. I tried "move file" and "copy file" but never would of thought of FSO, so this really helps, thanks

Regards

Russ (Programing on L plates..!)
Reply With Quote
Reply


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
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
File.Move reports file as in use DanRoche C# 3 May 3rd, 2007 07:27 AM
Using VBA Code to Move Data Nanette Access VBA 1 November 3rd, 2006 04:16 PM
Can't Move Network File peter2004 ASP.NET 1.0 and 1.1 Professional 1 September 3rd, 2006 02:34 PM
File Upload/Move surendran VB How-To 0 July 19th, 2006 04:31 AM



All times are GMT -4. The time now is 06:21 AM.


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