args Path, Ext, Sel static hwnd = win.handle("c=TTOTAL_CMD") static Exepath = win.exepath(hwnd) static Quote = esc(?+\"+, ?+\+) if(not Ext) do win.sendmessage(hwnd, 0x400+51, 2050, 0) Ext = "!!!" endif static Counter, PrevPath local Str, Type, i if(Counter && PrevPath == Path) jump SecondCall if(vec.exists(v)) do vec.destroy(v) Counter = "" endif PrevPath = Path local Report = miscplugin.tempfilename() Str = "/c dir " ++ Path ++ " /a:-d /o:e /b > " ++ Report local ExitCode = file.runwait(0, "cmd", Str, "", "hide") if(ExitCode) do messagebox("ok error", "File list not created", "CMD error") quit endif Str = file.readall(Report) v = vec.createfromlines(Str, 1, 1) if(v <= 0) do messagebox("ok error", "Vector not created", "VEC plugin error #1") quit endif for each Str in v if(not Str) continue Type = file.type(Str) if(Counter) do flag set 1 for(i = 0; i < Counter; i++) if(Type == file.type(v[i])) do flag clear 1 break endif endfor if(pproflag(1)) do vec.insert(v, Counter, Str) Counter++ else if(stricoll(v[i], Str) == 1) v[i] = Str endif else v[0] = Str Counter++ endif endfor @SecondCall for(i = 0; i < Counter - 1; i++) if(Ext != file.type(v[i])) continue Str = v[i + 1] do(Exepath,"/O /S /L=" ++ Quote ++ Path ++ Str ++ Quote) if(Sel) do win.sendmessage(hwnd, 0x400+51, 524, 0) win.sendmessage(hwnd, 0x400+51, 527, 0) endif break endfor