Results 1 to 10 of 10

Thread: copy with no Delete---

  1. #1

  2. #2
    Hyperactive Member Quiver318's Avatar
    Join Date
    Sep 2007
    Posts
    260

    Re: copy with no Delete---

    I would say that any intrinsic Windows Copy command would do the trick as opposed to a command like Move, which would delete the old after it copied.

  3. #3

    Thread Starter
    Fanatic Member sessi4ml's Avatar
    Join Date
    Nov 2006
    Location
    Near San Francisco
    Posts
    958

    Re: copy with no Delete---

    Copy/noDelete *.*

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: copy with no Delete---

    What are you referring to?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5

    Thread Starter
    Fanatic Member sessi4ml's Avatar
    Join Date
    Nov 2006
    Location
    Near San Francisco
    Posts
    958

    Re: copy with no Delete---

    I would like to copy/NoDelete to another folder. For example, Copy/NoDelete cell phone photos to folder on XP-disk drive...only files (photos) that no not exsist.
    Is there a copy program that will do this?

  6. #6
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: copy with no Delete---

    Ah ok! Although, I am still confusing about what you mean by "NoDelete", it sound like after you copy the data from the phone it deletes it doing a cut rather than a copy is that correct?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  7. #7

    Thread Starter
    Fanatic Member sessi4ml's Avatar
    Join Date
    Nov 2006
    Location
    Near San Francisco
    Posts
    958

    Re: copy with no Delete---

    Copy the files, but if the file already exsist, do not copy it
    Currently, I have to click on No 100 times...do not copy file.

  8. #8
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: copy with no Delete---

    I have made a program that might help! Do you have VB6 to compile the code or do you want me to upload the exe and send you the link?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  9. #9

    Thread Starter
    Fanatic Member sessi4ml's Avatar
    Join Date
    Nov 2006
    Location
    Near San Francisco
    Posts
    958

    Re: copy with no Delete---

    I have a VB6 compiler

  10. #10
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: copy with no Delete---

    This might work for you.

    vb Code:
    1. Option Explicit
    2. Private Declare Function OpenFile Lib "kernel32" (ByVal lpFileName As String, _
    3.                         lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long
    4.                        
    5.                         Private Type SHFILEOPSTRUCT
    6.     hwnd As Long
    7.     wFunc As Long
    8.     pFrom As String
    9.     pTo As String
    10.     fFlags As Integer
    11.     fAnyOperationsAborted As Long
    12.     hNameMappings As Long
    13.     lpszProgressTitle As Long ' only used if FOF_SIMPLEPROGRESS, sets dialog title
    14. End Type
    15. Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
    16. ' Available Operations
    17. Private Const FO_COPY = &H2 ' Copy File/Folder
    18. Private Const FO_DELETE = &H3  ' Delete File/Folder
    19. Private Const FO_MOVE = &H1  ' Move File/Folder
    20. Private Const FO_RENAME = &H4  ' Rename File/Folder
    21. ' Flags
    22. Private Const FOF_ALLOWUNDO = &H40  ' Allow to undo rename, delete ie sends to recycle bin
    23. Private Const FOF_FILESONLY = &H80  ' Only allow files
    24. Private Const FOF_NOCONFIRMATION = &H10  ' No File Delete or Overwrite Confirmation Dialog
    25. Private Const FOF_SILENT = &H4  ' No copy/move dialog
    26. Private Const FOF_SIMPLEPROGRESS = &H100  ' Does not display file names
    27. Private Const FOF_RENAMEONCOLLISION As Long = &H8 'Rename if there is a file of that name
    28. Private Const OF_EXIST         As Long = &H4000
    29. Private Const OFS_MAXPATHNAME  As Long = 128
    30. Private Const HFILE_ERROR      As Long = -1
    31. Private Type OFSTRUCT
    32.     cBytes As Byte
    33.     fFixedDisk As Byte
    34.     nErrCode As Integer
    35.     Reserved1 As Integer
    36.     Reserved2 As Integer
    37.     szPathName(OFS_MAXPATHNAME) As Byte
    38. End Type
    39.  
    40. Dim fullpath As String, lngReturn As Long, strReturn As Long, strSource As String, strTarget As String
    41.  
    42. Private Sub VBCopyFiles(ByRef strSource As String, ByRef strTarget As String)
    43.      Dim op As SHFILEOPSTRUCT, sFilename As String
    44. sFilename = Dir(strTarget & "\")
    45. Do While sFilename > ""
    46. sFilename = Dir()
    47. Loop
    48.     If FileExists(strTarget) = False Then
    49.      With op
    50.        .wFunc = FO_COPY  ' Set function
    51.        .pFrom = strSource ' Set current path
    52.        .pTo = strTarget  ' Set new path
    53.        .fFlags = FOF_SILENT Or FOF_NOCONFIRMATION
    54.       End With
    55.     'Perform operation
    56.      SHFileOperation op
    57.          If strSource <> "" Then
    58.             MsgBox ("Finished copying! Quitting.")
    59.             Unload Me
    60.         End If
    61.       End If
    62. End Sub
    63.  
    64.  
    65. Private Function FileExists(ByVal FName As String) As Boolean
    66. 'http://www.vbforums.com/showthread.php?t=349990
    67.     Dim lRetVal As Long
    68.     Dim OfSt As OFSTRUCT
    69.    
    70.     lRetVal = OpenFile(FName, OfSt, OF_EXIST)
    71.     If lRetVal <> HFILE_ERROR Then
    72.         FileExists = True
    73.     Else
    74.         FileExists = False
    75.     End If
    76.    
    77. End Function
    78.  
    79.  
    80. Private Sub Command1_Click()
    81.   VBCopyFiles source, destination
    82. End Sub

    I was using a form to test the code but it could probably work in a module using sub Main.

    For the SubMain just put:

    vb Code:
    1. VBCopyFiles source, destination

    Instead of using the CommandButton
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width