example : windows robocopy / drag&drop one folder/with subfolders / example HDD=E , copy to > DEST1 := hdd . ":\_MyTestFolder" ( E:\_MyTestFolder )
Code: Select all
;- windows robocopy / drag&drop one folder/with subfolders , example HDD=E , copy to > DEST1 := hdd . ":\_MyTestFolder"
#warn
#NoEnv
setworkingdir,%a_scriptdir%
Gui,2: -dpiscale
Gui,2:Color,Black,Black
Gui,2:Font,s12 cYellow,Lucida Console
wa:=A_screenwidth,ha:=A_screenHeight,xx:=100
;-
;----------- MAIN DESTINATION ------------------
HDD := "E"
if FileExist(HDD ":\")
{
DEST1 := hdd . ":\_MyTestFolder" ;- << main destination / copies here Folder\subfolders\files
ifnotexist,%dest1%
filecreatedir,%dest1%
}
else
{
msgbox, 262208,Warning, HDD "%HDD%" not found.
exitapp
}
;-----------------------------------------------
Menu,S1 ,add,EDIT_ThisScript ,MH1
Menu,S2 ,add,OPEN_ThisFolder ,MH2
Menu,S3 ,add,RELOAD ,MH3
menu,myMenuBar,Add,ThisScript ,:S1
menu,myMenuBar,Add,ThisFolder ,:S2
menu,myMenuBar,Add,RELOAD ,:S3
Gui,2:menu,MyMenuBar
recx:=""
dest2:=""
;-----------
text9:="SOURCE Drag & Drop only FOLDER"
x:=(wa*1)/xx,y:=(ha*1)/xx,w:=(wa*8)/xx
Gui,2:add,text,x%x% y%y% w%w%,%text9%
x:=(wa*9)/xx,y:=(ha*1)/xx,w:=(wa*40)/xx,h:=(ha*2.6)/xx
Gui,2:add,Edit, x%x% y%y% w%w% h%h% -vscroll vSOURCE1
;-
x:=(wa*1)/xx,y:=(ha*5)/xx,w:=(wa*15)/xx
Gui,2:add,text,x%x% y%y% w%w%,DESTINATION :
x:=(wa*9)/xx,y:=(ha*5)/xx,w:=(wa*40)/xx,h:=(ha*2.6)/xx
Gui,2:add,Edit, x%x% y%y% w%w% h%h% -vscroll vDEST1x readonly,%dest1%
;-
x:=(wa*1)/xx,y:=(ha*10)/xx
Gui,2:Add, Text , x%x% y%y% ,Folders=
x:=(wa*5)/xx,y:=(ha*10)/xx,w:=(wa*3)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Edit , x%x% y%y% w%w% h%h% -vscroll vCount1 right readonly
;-
x:=(wa*1)/xx,y:=(ha*14)/xx
Gui,2:Add, Text , x%x% y%y% ,Files=
x:=(wa*5)/xx,y:=(ha*14)/xx,w:=(wa*3)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Edit , x%x% y%y% w%w% h%h% -vscroll vCount2 right readonly
;-
x:=(wa*1)/xx,y:=(ha*18)/xx,w:=(wa*6)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Button , x%x% y%y% w%w% h%h% gStart vBTStart,START
;-
x:=(wa*8)/xx,y:=(ha*18)/xx,w:=(wa*15)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Edit , x%x% y%y% w%w% h%h% -vscroll vText1 readonly
;-
x:=(wa*24)/xx,y:=(ha*18)/xx,w:=(wa*6)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Button , x%x% y%y% w%w% h%h% gClear vBTclear,Clear
;-
x:=(wa*31)/xx,y:=(ha*18)/xx,w:=(wa*6)/xx,h:=(ha*2.6)/xx
Gui,2:Add, Button , x%x% y%y% w%w% h%h% gFolder vBTFolder,FOLDER
;-
Gui,2:add,text,x0 y0 w0 h0 vT1
x:=(wa*20)/xx,y:=(ha*20)/xx,w:=(wa*50)/xx,h:=(ha*24)/xx
Gui,2:Show, x%x% y%y% w%w% h%h%,COPY
GuiControl,2:Disable,btstart
GuiControl,2:Disable,btfolder
GuiControl,2:Disable,btClear
Return
;-----------------------
2Guiclose:
if (recx=1)
{
msgbox, 262208,COPY ,COPY is running
return
}
else
exitapp
;-----------------------
2GuiDropFiles:
AAC:=a_guievent
SplitPath,AAC, name, dir, ext, name_no_ext, drive
if ext<>
return
Gui,2:submit,nohide
GuiControl,2:,Text1,
GuiControl,2:,count1,
GuiControl,2:,count2,
dest2:=dest1 . "\" . name
GuiControl,2:,Source1,%AAC%
GuiControl,2:,dest1x,%dest2%
;-----
filesx:=""
foldersx:=""
Loop, Files, %aac%\*.*, FR
Filesx := A_Index
Loop, Files, %aac%\*.*, DR
Foldersx := A_Index
GuiControl,2:,count1,%foldersx%
GuiControl,2:,count2,%filesx%
GuiControl,2:Enable,btstart
return
;----------------------
Start:
Gui,2:submit,nohide
if (source1="")
{
msgbox, 262208, ,SOURCE is not selected
return
}
GuiControl,2:,Text1,Copy is running .....
starttime := A_TickCount
recx=1
runwait, %comspec% /c robocopy "%source1%" "%dest2%" /XO /E /UNICODE,,hide ;- <<<< robocopy running
recx=0
aat:=(A_TickCount - starttime)//1000
GuiControl,2:,Text1,COPY FINISHED in %aat% seconds
aat=
source1=
AAC=
GuiControl,2:Disable,btstart
GuiControl,2:Enable,btfolder
GuiControl,2:Enable,btClear
GuiControl,2: Focus, T1
return
;--------------------
clear:
AAC=
source1=
GuiControl,2:,Text1,
GuiControl,2:,Source1,
GuiControl,2:,count1,
GuiControl,2:,count2,
GuiControl,2:,dest1x,%dest1%
GuiControl,2:Disable,btstart
GuiControl,2:Disable,btfolder
GuiControl,2:Disable,btClear
return
;--------------------
Folder:
try
run,%dest2%
return
;--------------------
mh1:
editorx1=C:\Program Files\Notepad++\notepad++.exe
ifnotexist,%editorx1%
editorx1:=""
ifexist,%editorx1%
run,%editorx1% "%a_scriptfullpath%"
else
run, notepad "%a_scriptfullpath%"
return
;-----------
mh2:
run,%a_scriptdir%
return
;-----------
mh3:
if (recx=1)
{
msgbox, 262208,COPY ,COPY is running
return
}
else
reload
return
;-----------
;=====================================================================