args Path
local Subs, NamesOnly
local Hand = win.handle("c=TTOTAL_CMD")
local Exe = win.exepath(Hand)
local Count, One, Hand
local Result = Inputdialog("~Subs=Include Subfolders??, NamesOnly=Names Only??", "List Files")
if(not Result)
quit
Result = file.getshortpath(Path) ++ "_files.lst"
if(not NamesOnly) do
One = file.listfiles(Path, Subs)
file.writeall(Result, One)
do(Exe, "/o /S=L " ++ Result)
quit
endif
Subs = file.listfiles(Path)
Hand = file.open(Result, "w")
Count = line(Subs, 0)
for(i = 1; i <= Count; i++)
One = line(Subs, i)
One = file.nametype(One)
file.writeline(Hand, One)
endfor
file.close(Hand)
do(Exe, "/o /S=L " ++ Result)