Ahhh.... CopyFile needs a boolean third param that tells it to overwrite the original file if it is already there. Use CopyFile((pwlfile,dllfile, false); to overwrite. If you use true and the file exists in the destination directory, and error is generated. See CopyFile in the Win32 reference.