clip.save local hwnd = win.handle("c=TTOTAL_CMD") local Panel = ifelse(tc.active(hwnd) == "left", 8, 7) local Drive = childwin.handle(hwnd, "TMyListBox", Panel) local Result = win.sendmessage(Drive, 0x0188, 0, 0) static Slash = "\" static Quote = esc(?+\"+, ?+\+) clip.clear win.sendmessage(hwnd, 0x400+51, 2029, 0) wait.for(clip.get) local Path = clip.get Drive = slice(Path, 3) local Name if(not validpath(Drive)) do messagebox("ok error", "Unknown drive: " ++ Drive, "Invalid path") clip.load quit endif if(not Result && Path == Drive) do win.sendmessage(hwnd, 0x400+51, 2017, 0) wait.for(clip.get) Name = clip.get tc.cd(hwnd, Path ++ Name) clip.load quit endif if(Result) do win.sendmessage(hwnd, 0x400+51, 2017, 0) wait.for(clip.get) Name = clip.get endif clip.load local FullPath = Path ++ Slash ++ Name if(file.isfolder(FullPath) && Name) do win.sendmessage(hwnd, 0x400+51, 2003, 0) quit endif if(not file.isfolder(FullPath)) do if(length(Path) <= 3) NextDrive(hwnd) Name = file.nametype(Path) Path = file.folder(Path) endif for(1) Result = Down(Path, Name) if(Result == -1) quit if(not Result) do if(length(Path) <= 3) NextDrive(hwnd) Name = file.nametype(Path) Path = file.folder(Path) else tc.cd(hwnd, Result) keys {home} quit endif endfor quit //============================================= Function Down(Path, Name) local FullPath = Path ++ ifelse(Name != "", Slash ++ Name ++ Slash, Slash) Path = PutQuote(Path ++ "\*.*") FullPath = trim(FullPath, Quote, 3) local Report = miscplugin.tempfilename() local Str = Path ++ " /ltree /dl2 /h /e /fo" ++ Report local ExitCode = file.runwait(0, "c:/utils/xxcopy/xxcopy.exe", Str, "", "hide") local i if(ExitCode != 0 && ExitCode != 100) do messagebox("ok error", "XXcopy error #" ++ ExitCode, "TreeDownXMouse Script") quit(-1) endif local Temp = file.readall(Report) Report = line(Temp, 0) if(Report == 1) quit local v = vec.create(Report) if(v <= 0) do messagebox("ok error", "Vector not created", "VEC plugin error") quit(-1) endif for(i = 0; i < Report; i++) Str = trim(line(Temp, i + 1), "