thank you tank for the example
here just a small ahk script to select a folder and then copy all txt ( or other) files to c:\_COPIED1
Code:
COPIED =c:\_COPIED1
run,%COMSPEC% /C if not exist \%COPIED%\NUL MD %Copied%,,hide
FileSelectFolder,Var1, , 3
if VAR1=
exitapp
Loop, %var1%\*.*, , 1
{
A=%A_loopfileext%
if (A="txt" or a="lnk" or a="rtf") ;(extension)
{
SplitPath,A_LoopFileFullPath, namex, dir, ext, name_no_ext, drive
Filecopy,%A_LoopFileFullPath%,%copied%\%namex%
}
}
run,%copied%
exitapp
another example with drag and drop
Code:
;--------------------- drag&drop example ( used for blat.exe ) -----------------------------------------------
MODIFIED = 20090202
Filename1 = Drag&Drop Example
#NoEnv
#SingleInstance force
SetBatchLines,-1
setworkingdir, %a_scriptdir%
AutoTrim Off
txtfil=_FileText.txt
binfil=_Filebin.txt
ifexist,%txtfil%
filedelete,%txtfil%
ifexist,%binfil%
filedelete,%binfil%
Gui,3:default
Gui,3:Color, 000000
Gui,3:Font,S10 CDefault,Verdana
Gui 3:Add, Text, x100 y10 cWhite ,ATTACHMENTS put here
Gui 3:Add, Edit,cWhite x6 y40 w750 h350 vMsg2 readonly, ;ATTACH input files her
Gui 3:Add, Button, x570 y5 w90 h25 gClearMSG2, CLEAR-ATT
Gui 3:Show, x10 y30 w770 h370 ,%filename1%
Return
;---------------
3GuiClose:
3GuiEscape:
ExitApp
;-----------------
CLEARMSG2:
Gui,3:submit,nohide
Selectedfilename=
GuiControl,3:,MSG2,%nothing%
ifexist,%txtfil%
filedelete,%txtfil%
ifexist,%binfil%
filedelete,%binfil%
return
3GuiDropFiles:
Gui,3:submit,nohide
Loop, parse, A_GuiEvent, `n
{
SelectedFileName = %SelectedFileName%`r`n%A_LoopField% ;write files-names
SplitPath,A_loopfield, name, dir, ext, name_no_ext, drive
if ext=txt
Fileappend,%A_LoopField%`,,%txtfil%
else
Fileappend,%A_LoopField%`,,%binfil%
}
GuiControl,3:,MSG2,%SelectedFileName%
return
;---------------------------------------------------------------------------