Re: Copying files in a certain date range to other locations
- From: "aalaan" <invalid@xxxxxxxxxxx>
- Date: Tue, 26 Dec 2006 16:20:33 +1100
Thanks Jim. Happy Holiday to you to. There was something much much simpler
that someone showed me that used the Dir function/statement. I can get the
FileDate OK. It's just the syntax for looping through a given
directory/folder using Dir
"Jim Carlock" <anonymous@localhost> wrote in message
news:u93vOmKKHHA.2632@xxxxxxxxxxxxxxxxxxxxxxx
"aalaan" posted:
: Using vb5 I am trying to loop through a folder and select files
: within a certain date range and copy to another location. Can
: someone assist?
http://vbnet.mvps.org/?code/fileapi/copyfile.htm
http://vbnet.mvps.org/?code/shell/shfileopadv.htm
http://vbnet.mvps.org/?code/shell/shdirectorycopy.htm
Those links were found by typing the following into the Google
search textbox.
copy files site:vbnet.mvps.org
One of those should get you going in the right direction as far as
file copying goes. For the date time, I typed the following into
the Google search box...
file dates site:vbnet.mvps.org
http://vbnet.mvps.org/index.html?code/fileapi/filedatetime.htm
Randy Birch does such a great job with the code and the layout
at that site, that it ends up invaluable for many basic things, any
kind of file operations, many registry ops, and quite a few other
things as well.
With that said, I'll mention a couple extra things about file copying.
IF your moving files, rather than copying, it's always better to use
whatever "MOVE" mechanisms are available, rather than file copy
and then file delete. I'm going to date myself now (and I hope it
applies to NTFS as it did to FAT and FAT32 file systems), when
using one of the DOS MOVE commands, the command ends up
changing FAT pointers rather than actually moving the file and
moving ends up much faster than copying and deleting, and it
ends up as a safer way to do things with one exception... as long
as your moving files from one folder to another on the same
drive partition. Once you go to another partition or another drive,
the move command behaves like a copy and delete and copy
and delete can be better choices in those cases.
If your copying files through a batch file, xcopy works better
than copy. Also you want to use the xcopy command with the
/v switch applied, as it adds some extra verification to help make
sure the files get copied properly.
You can use ShellExecute() and create a batch file to do mass
copies. I'm not sure if any of the links I provided above offer
a verification switch to verify the files get copied properly, so
you'll want to look for that if no one else posts anything here.
Happy holidays.
--
Jim Carlock
Post replies to the group.
.
- Follow-Ups:
- Re: Copying files in a certain date range to other locations
- From: Jim Carlock
- Re: Copying files in a certain date range to other locations
- References:
- Copying files in a certain date range to other locations
- From: aalaan
- Re: Copying files in a certain date range to other locations
- From: Jim Carlock
- Copying files in a certain date range to other locations
- Prev by Date: Re: Copying files in a certain date range to other locations
- Next by Date: Re: Copying files in a certain date range to other locations
- Previous by thread: Re: Copying files in a certain date range to other locations
- Next by thread: Re: Copying files in a certain date range to other locations
- Index(es):
Relevant Pages
|