?
Solved

How to copy a complete cd to a folder on harddrive and give some feedback?

Posted on 2006-11-01
2
Medium Priority
?
167 Views
Last Modified: 2010-04-05
Hi there!

I would like my program to calculate the total size of the files and folders present on the cdrom as well as number of files and folders, then copy the entire cdrom to a folder on harddrive and report if success or fail.

Kind regards,

Paul
0
Comment
Question by:PeterdeB
[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
2 Comments
 

Author Comment

by:PeterdeB
ID: 17851850
Something like this..thanks to Madshi I believe :)

procedure CopyDir(FromDir, ToDir : string);
var
 FOS :tSHFileOpStruct;
begin
  FromDir := Trim(FromDir);
  if FromDir[Length(FromDir)] <> '\' then FromDir := FromDir + '\';
  ToDir := Trim(ToDir);
  with FOS do
  begin
    Wnd := Application.Handle;
    wFunc := FO_COPY;
    pFrom := PChar(FromDir + '*.*' + #0);
    pTo := PChar(ToDir + #0);
    fFlags := FOF_ALLOWUNDO or FOF_MULTIDESTFILES or FOF_NOCONFIRMMKDIR;
  end;
  SHFileOperation(FOS);
end;

// usage:
procedure TForm1.Button1Click(Sender: TObject);
begin
  CopyDir('c:\tools','d:\tools');
  CopyDir('a:\', 'c:\archive');
end;
0
 
LVL 12

Accepted Solution

by:
Ivanov_G earned 2000 total points
ID: 17854016
http://www.awitness.org/delphi_pascal_tutorial/source/directory_search_recursive.html
you can also look in folder recursively if you want to make a dialog showing "File ......xxxx..... being copied"

For total size of the CD you can use DiskSize function, DiskSize(i) where i=
1 = A drive
2 = B drive
3 = C drive
0

Featured Post

Independent Software Vendors: 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!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

801 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