[Req] Copy\Move files to each folder to Branch View panel

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Xtrician
Senior Member
Senior Member
Posts: 412
Joined: 2005-04-24, 10:29 UTC
Location: Israel

[Req] Copy\Move files to each folder to Branch View panel

Post by *Xtrician »

I Just copy a new files from panel in Full mode to panel in Branch View mode and its moving me the files to C:\Pictures.. its not overwrite the files to each folder like i think...

It will very very useful to make Copy\Move files to each folder to Branch View panel.
User avatar
van Dusen
Power Member
Power Member
Posts: 684
Joined: 2004-09-16, 19:30 UTC
Location: Sinzig (Rhein), Germany

Post by *van Dusen »

You could try this AutoIT-Script:

Code: Select all

AutoItSetOption("WinTitleMatchMode", 4)

Dim $rcall = 0

$tcwinhandle = WinGetHandle("classname=TTOTAL_CMD")
;*** cm_CopyFullNamesToClip=2018;Copy names with full path
DllCall("user32.dll", "int", "SendMessage", "hwnd", $tcwinhandle, "int", 1075, "int", 2018)
$tcpnl = StringSplit(ClipGet(), @CRLF, 1)

Send("{TAB}^{NUMPADADD}")
;*** cm_CopyFullNamesToClip=2018;Copy names with full path
DllCall("user32.dll", "int", "SendMessage", "hwnd", $tcwinhandle, "int", 1075, "int", 2018)
$tctml = StringSplit(ClipGet(), @CRLF, 1)
Send("^{NUMPADSUB}{TAB}")

For $i = 1 To $tcpnl[0]
   
   $tcpn = StringSplit($tcpnl[$i], "\")
   $tcn = StringUpper($tcpn[$tcpn[0]])
   
   For $j = 1 To $tctml[0]
      If StringRight(StringUpper($tctml[$j]), StringLen($tcn)) = $tcn Then
         
         $msgtxt = "Overwrite" & @LF & @LF
         
         $msgtxt = $msgtxt & $tctml[$j] & @LF
         $fdatemod = FileGetTime($tctml[$j], 0, 0)
         $msgtxt = $msgtxt & "   " & $fdatemod[0] & "-" & $fdatemod[1] & "-" & $fdatemod[2] & " " & $fdatemod[3] & ":" & $fdatemod[4]
         $msgtxt = $msgtxt & " • " & FileGetSize($tctml[$j])
         $msgtxt = $msgtxt & " • " & FileGetAttrib($tctml[$j]) & @LF & @LF
         
         $msgtxt = $msgtxt & "with" & @LF & @LF
         
         $msgtxt = $msgtxt & $tcpnl[$i] & @LF
         $fdatemod = FileGetTime($tcpnl[$i], 0, 0)
         $msgtxt = $msgtxt & "   " & $fdatemod[0] & "-" & $fdatemod[1] & "-" & $fdatemod[2] & " " & $fdatemod[3] & ":" & $fdatemod[4]
         $msgtxt = $msgtxt & " • " & FileGetSize($tcpnl[$i])
         $msgtxt = $msgtxt & " • " & FileGetAttrib($tcpnl[$i]) & @LF
         
         If $rcall <> 6 Then $rcsingle = MsgBox(3+32+256, "SpreadedUpdate - Overwrite Confirmation", $msgtxt)
         
         Select
            ;*** Yes-Button pressed
            Case $rcsingle = 6 Or $rcall = 6
               If $rcall = 0 Then $rcall = MsgBox(4+32+256, "SpreadedUpdate - Auto Confirmation", "Yes to all files?")               
;~                FileCopy($tcpnl[$i], $tctml[$j], 1)
               MsgBox(0, "SpreadedUpdate - Yes pressed", "Copy would be done, if 'FileCopy'-Command were uncommented")
            ;*** No-Button pressed
            Case $rcsingle = 7
               ;NOP
            ;*** Otherwise (Cancel-Button pressed e.g.)
            Case Else
               Exit(0)
         EndSelect
         
      EndIf
   Next
Next
For testing no copying is actual done. If you have tested the script and if you are sure, that the script does what it should, just uncomment the line with the "FileCopy" command (delete the leading ";~" from the line) and delete or comment the following "MsgBox" command (add a leading ";").

Some more remarks:

• The script uses the clipboard and overwrites its content (clipboard content is lost)
• Your selection in the target panel is lost (the script marks all entries in the target panel and copy full names to clipboard)
• It is assumed, that the hotkeys <Tab>, <Ctrl><Num+> and <Ctrl><Num-> are not redefined.
Post Reply