Wrox Programmer Forums
|
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 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 June 25th, 2003, 02:52 PM
Authorized User
 
Join Date: Jun 2003
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..!)
 
Old June 25th, 2003, 02:56 PM
Friend of Wrox
 
Join Date: Jun 2003
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
 
Old June 26th, 2003, 01:04 PM
Authorized User
 
Join Date: Jun 2003
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..!)





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





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