in the sample code below i get a list only in one checkbox for all the folders\files found,
i need help to get the list of each folder\file in separately checkbox.
thanks in advance!
Code: Select all
vDir1 := "C:"
vList := ""
CSize := 0
; folders
foldersBlacklist := "Windows,Users,$Recycle.Bin,Program Files,Program Files (x86),ProgramData"
excludedFolders := ""
; files
filesExtBlacklist := "log,sys,cmd,bat,bak,ini,txt,dll,err,db"
filesBlacklist := "bootmgr,kk1.exe,pv.exe,Uninstal.exe"
excludedFiles := ""
Loop, Files, % vDir1 "\*", D ; folders
{
if A_LoopFileName in %foldersBlacklist%
{
excludedFolders .= """" . A_LoopFileFullPath . """ "
continue
}
vList .= A_LoopFileFullPath . "|"
}
Loop, Files, % vDir1 "\*", F ; files
{
if A_LoopFileExt in %filesExtBlacklist%
{
excludedFiles .= """" . A_LoopFileFullPath . """ "
continue
}
if A_LoopFileName in %filesBlacklist%
{
excludedFiles .= """" . A_LoopFileFullPath . """ "
continue
}
vList .= A_LoopFileFullPath . "|"
CSize += A_LoopFileSize ; count in c:\ root only
}
vList := SubStr(vList, 1, -1)
listC := % StrReplace(vList, "|", "`n")
Loop, Parse, vList, |
Loop, Files, % A_LoopField "\*", FR
CSize += A_LoopFileSize ; count in c:\ folders
;~ MsgBox, % StrReplace(vList, "|", "`n") ; show white list
;~ MsgBox, % StrReplace(excludedFolders, (vDir1 . "\"), "") ; show foldersBlacklist
;~ MsgBox, % StrReplace(excludedFiles, (vDir1 . "\"), "") ; show filesExtBlacklist & filesBlacklist
Gui Add, Checkbox, vResotreChoice, % StrReplace(vList, "|", "`n")
Gui Show