Copying (or moving) a file

Posted on 2006-04-08
Last Modified: 2010-08-05
I try to copy a file using CopyFile function:

Windows.CopyFile(PChar(SourceFile), PChar(TargetFile), True);

The file is copied, but not to a target folder, but to the SourceFile folder. The same is when I try MoveFile().

The folders are specified correctely. I use D6 and WinXP.
Question by:shrldu
    LVL 12

    Accepted Solution

    Tell us how do you specify the folders and make sure that you use absolute paths ('C:\folder1\folder2\'), not relative ('\folder2').

    Author Comment

    Sorry, my simple and stupid error. Thanks for your comment! :)

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    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…
    Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    737 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now