Copy file from CD to hard drive

Hi

I'm trying to copy file from CD  to hard drive
and i get file not found it's dose'nt work with app.path
(the file that i try to copy is in the dir in the cd)

can i get sample how it's has to work currect

Regard Kobi
Kobi55Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

aelatikCommented:
It goes like this :

FileCopy "D:\BIN\FILE.DAT C:\FILE.DAT"
0
aelatikCommented:
Sorry typo, like this :

FileCopy "D:\BIN\FILE.DAT", "C:\FILE.DAT"
0
aelatikCommented:
Oo, misunderstood the question.
What do you get when you do msgbox app.path ( is it the CDROM drive ? )
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Kobi55Author Commented:
it's not work from app.path

for exsample my  CD is "E" and my folder in the CD is "Files"

i try "curdir" and "dir" and with file "systemobject "and it give me the error  "file not found"
0
EDDYKTCommented:
Where is your program? Is it reside on CD or hard drive.
If it is in hard drive, then app.path will not work
0
nffvrxqgrcfqvvcCommented:
' put the following code into a module .BAS file
'

Public Const PROGRESS_CANCEL = 1
Public Const PROGRESS_CONTINUE = 0
Public Const PROGRESS_QUIET = 3
Public Const PROGRESS_STOP = 2
Public Const COPY_FILE_FAIL_IF_EXISTS = &H1
Public Const COPY_FILE_RESTARTABLE = &H2
Public Declare Function CopyFileEx Lib "kernel32.dll" Alias "CopyFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As Long, lpData As Any, ByRef pbCancel As Long, ByVal dwCopyFlags As Long) As Long
Public bCancel As Long
Public Function CopyProgressRoutine(ByVal TotalFileSize As Currency, ByVal TotalBytesTransferred As Currency, ByVal StreamSize As Currency, ByVal StreamBytesTransferred As Currency, ByVal dwStreamNumber As Long, ByVal dwCallbackReason As Long, ByVal hSourceFile As Long, ByVal hDestinationFile As Long, ByVal lpData As Long) As Long
   
    Form1.Caption = CStr(Int((TotalBytesTransferred * 10000) / (TotalFileSize * 10000) * 100)) + "% complete..."

    DoEvents
   
    CopyProgressRoutine = PROGRESS_CONTINUE
End Function

'put this code in a command button or wherever you want to put it to copy the file from cd
'

Dim Ret As Long
    Me.AutoRedraw = True
    Me.Show
    'start copying
    'change manual.pdf to the filename
    Ret = CopyFileEx("E:\Files\MANUAL.PDF", "c:\MANUAL.PDF", AddressOf CopyProgressRoutine, ByVal 0&, bCancel, COPY_FILE_RESTARTABLE)
   
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
gbzhhuCommented:
This works just fine for me.  F is my CDROM drive

    Dim fso As FileSystemObject
   
    Set fso = New FileSystemObject
   
    fso.CopyFile "F:\Hassan\Reg Clean\Readme.txt", "D:\Readme.txt"
   
    Set fso = Nothing

Make sure the CDROM drive is readable by trying it manually
0
AerocomCommented:
Rember after you have copied the file to the hard drive to check and re-set the property - its will be read only on the CD!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.