ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Copy over files/replace (complete question) (https://www.excelbanter.com/new-users-excel/49491-copy-over-files-replace-complete-question.html)

G3£Wh\)zZ@

Copy over files/replace (complete question)
 
Cat walked over keyboard and actually sent the previous post uncomplete so
here it is complete..thansk for reading.

I have a lot of files on cd/dvd that i am moving into one folder on my hdd
so i can sort them out before reburning them. However there are quiet a few
mp3 files that have the same name etc but because i converted these at a
higher bit rate they are larger in size, whilst moving them to the folder i
keep getting the "would i like to replace the existing file" and have to
click either yes or no.

Its a pain ...so is there anything out there or anything i can do , that
will only copy/replace the original file if the new file is larger in size..


--
The Source For Premium Newsgroup Access
Great Speed, Great Retention
1 GB/Day for only $8.95

Mel Arquiza

Option Explicit
Declare Function CopyFile Lib "kernel32" Alias "CopyFileA" (ByVal
lpExistingFileName As String, _
ByVal lpNewFileName As String, ByVal bFailIfExists As Long) As Long

Public Function APIFileCopy(src As String, dest As String, _
Optional FailIfDestExists As Boolean) As Boolean

'PURPOSE: COPY FILES
'PARAMETERS: src: Source File (FullPath)
'dest: Destination File (FullPath)
'FailIfDestExists (Optional):
'Set to true if you don't want to
'overwrite the destination file if
'it exists

'Returns (True if Successful, false otherwise)

'EXAMPLE:
'dim bSuccess as boolean
'bSuccess = APIFileCopy ("C:\MyFile.txt", "D:\MyFile.txt")

Dim lRet As Long
lRet = CopyFile(src, dest, FailIfDestExists)
APIFileCopy = (lRet 0)
End Function

Hope this helps.

"G3£Wh)zZ@" wrote:

Cat walked over keyboard and actually sent the previous post uncomplete so
here it is complete..thansk for reading.

I have a lot of files on cd/dvd that i am moving into one folder on my hdd
so i can sort them out before reburning them. However there are quiet a few
mp3 files that have the same name etc but because i converted these at a
higher bit rate they are larger in size, whilst moving them to the folder i
keep getting the "would i like to replace the existing file" and have to
click either yes or no.

Its a pain ...so is there anything out there or anything i can do , that
will only copy/replace the original file if the new file is larger in size..


--
The Source For Premium Newsgroup Access
Great Speed, Great Retention
1 GB/Day for only $8.95



All times are GMT +1. The time now is 05:48 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com