ListFiles

Title ListFiles
File Name ListFiles.txt
Description Create _files.lst file listing all files in the current directory (and subdirectories, if needed)
Author Vochomurka
Parameters "%P"
Plugins Called file, win
Icon
Version 2.0
Updated on 08.06.2009
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)

All Scripts Total Commander TotalCmd.net PowerPro