I have some files in one folder and these same files in another folder with a lot more files. How do I delete these files in that folder with a lot more files?
thank you in advance.
thank you in advance.

; Set environment.
SetBatchLines, -1
SetControlDelay, -1
DetectHiddenWindows, On
SetWorkingDir, %A_ScriptDir%
; Build main GUI.
GoSub, Gui_Build_Main
Return ; End of auto-execute section.
Gui_Build_Main:
{
; Build GUI.
Gui, Margin, 3, 5
Gui, Add, Text , xm ym w50 h20 Right 0x200 , Folder #1:
Gui, Add, Edit , xm+55 ym w270 h20 vFolder_1 ,
Gui, Add, Button , xm+330 ym w30 h20 vBrowse_1 gBrowse, ...
Gui, Add, Text , xm ym+25 w50 h20 Right 0x200 , Folder #2:
Gui, Add, Edit , xm+55 ym+25 w270 h20 vFolder_2 ,
Gui, Add, Button , xm+330 ym+25 w30 h20 vBrowse_2 gBrowse, ...
Gui, Add, Button , xm+170 ym+53 w190 h25 vDelete gDelete, &Delete matching files to Recycle Bin
Gui, Add, Statusbar
SB_SetText( "Ready.", 1 )
GUI_ID := WinExist()
Gui, Show, AutoSize Center, Match & Recycle
}
Return
GuiEscape:
GuiClose:
{
ExitApp
}
Return
Delete:
{
Gui, 1: Submit, NoHide
; Basic pre-check.
If ( Folder_1 = "" OR Folder_2 = "" OR ! FileExist( Folder_1 ) OR ! FileExist( Folder_2 ) )
{
MsgBox, 48, Error, Please select valid folders.
Return
}
Loop, % Folder_1 . "\*.*", 0, 0
{
SB_SetText( "Processing: " . A_LoopFileName, 1 )
If FileExist( Folder_2 . "\" . A_LoopFileName )
{
FileRecycle, % Folder_2 . "\" . A_LoopFileName
}
}
SB_SetText( "Done.", 1 )
}
Return
Browse:
{
Gui, 1: Submit, NoHide
If ( A_GuiControl = "Browse_1" )
{
Folder_1 := ""
FileSelectFolder, Folder_1, , 2, Select first folder.
If ( ErrorLevel != 1 )
{
GuiControl, Text, Folder_1, % Folder_1
}
}
Else If ( A_GuiControl = "Browse_2" )
{
Folder_2 := ""
FileSelectFolder, Folder_2, , 2, Select second folder.
If ( ErrorLevel != 1 )
{
GuiControl, Text, Folder_2, % Folder_2
}
}
; Right justify the edit control's content if longer than the control's length
SendMessage, 0xB1, 500, 500, Edit1 ; 0xB1 is EM_SETSEL
SendMessage, 0xB1, 500, 500, Edit2 ; 0xB1 is EM_SETSEL
}
ReturnOriginal address: https://www.donationcoder.com/forum/index.php?topic=20568.0