Solved

Coping Mulitiple files

Posted on 1998-10-27
14
162 Views
Last Modified: 2010-04-30
How can I copy all the files in a directory to disk a in vb
example:
copy (mydir\*.* a:\
thank you
0
Comment
Question by:sear
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 7
14 Comments
 
LVL 12

Accepted Solution

by:
mark2150 earned 20 total points
ID: 1441910
Easiest is to use SHELL to DOS:

SHELL( "COPY MYDIR\*.* A:\"), 1

Variant is use ExecCmd that will wait for copy to complete before continuing.

You might want to check if there is enough space on A: for the size of the files.

Use DIR() to load find filenames. Then use FileLen() to determine size. Keep running total and then check against space on A:

M
0
 
LVL 15

Expert Comment

by:ameba
ID: 1441911
mark2150 wrote:
>SHELL( "COPY MYDIR\*.* A:\"), 1
try again
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441912
Umm, COPY is internal command. Use XCOPY as external and/or

SHELL("C:\COMMAND.COM /C COPY MYDIR\*.* A:\"), 1

0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 15

Expert Comment

by:ameba
ID: 1441913
Good answer. Or
SHELL(Environ("COMSPEC") & " /C COPY MYDIR\*.* A:\"), 1
(BTW, I didn't see anybody using other then C:\COMMAND.COM)
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441914
Yeah, I know about ENVIRON, but I didn't want to confuse the issue with another command.

ExecCmd is preferred anyway as it will *wait* for child to finish.

Have code if you need it.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1441915
It would be nice to have "animation" like in explorer or when emptying recycle bin. But this is another question (hard?)
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441916
Not really. Use a picture clip to hold the animation frames and twirl the images while you're waiting for ExecCmd to return instead of spending time in spin loop.
0
 
LVL 15

Expert Comment

by:ameba
ID: 1441917
Sounds easy. But creating animation frames is not trivial.
Unless you have a designer in your company.
I thought OS animations, like SHFileOperation in Win95.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441918
Depends on how complex an animation you want. Was able to do a "spinning" moon based on a 32x32 icon file in just a few minutes. Generated 8 different images with moon running to full-new-full. Looks neat. Kind of a complement to the Netscape spinning earth.

Take the trash animation, add flames, twiddle the flames a couple of times. Wind up with empty bin. Should give you a good six or eight frame sequence without getting too fancy.

M



0
 
LVL 15

Expert Comment

by:ameba
ID: 1441919
Nice job, mark2150. If I knew this, I would consider switching to designers job. Do you know what is the price for a little logo? Here, designers (Corel, Photoshop...) are better paid then academic painters.
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441920
Logo is corporate entity and needs a lot of thought/skill to create. SIlly little button animations are not hard to create esp if they're all related. Ever draw little stick figures in the margins of a book to make simple animation? Same technique only done electronically.

M

0
 
LVL 15

Expert Comment

by:ameba
ID: 1441921
OK. Don't take my words too serious. Recently I needed a logo for my small, 1-man company. It would be nice also to have a nice logo for each software product. For now, all I can do is create nice 32*32 icon.
Now, I will go to your web page. I am curious if I will see icon for your software in Florida. It must be something like:
###
###

:)
0
 
LVL 12

Expert Comment

by:mark2150
ID: 1441922
I whip up icons for the code, for my page you'll find my signature and my "grinnin' ape" picture - actually I embed them in my projects. Usually if you double click on the main form off of any controls the "hidden" copyright will appear.

M

0
 
LVL 15

Expert Comment

by:ameba
ID: 1441923
Nice job. Also nice web pages and family. Dennis is also OK!
See you on other questions.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question