local Path = file.folder(arg(1)) Path = file.folder(Path) local hwnd = win.handle("c=TTOTAL_CMD") local List, Count, Dest, Folder for(1) List = file.listfiles(Path, "2") Count = line(List, 0) if(Count < 2) do Folder = ifelse(Dest == "", remove(arg(1), -1), Dest) Dest = Path Path = file.folder(Path) else break endif endfor if(Dest == "") quit Path = arg(1) ++ "*.* " ++ Dest ++ " /s /rc /yy" file.runwait(0, "c:\utils\xxcopy\xxcopy.exe", Path, "", "hide") tc.cd(hwnd, Dest) wait 1 file.delete(Folder) win.postmessage(hwnd, 0x400+51, 540, 0)