By this snippet you can list/index a specific path with specific extension(s) to a text file. (Indexing duration depends on amount of folders/files you have and your PC speed.)
Usage: /findex [-nx] [Extension]
Example: /findex -nx *.mp3 D:Music
[-nx] properties and [Extension(s)] are optional.
n: To exclude the path which you enter with your command.
x: To index a specific file extension(s).
You can specify one or more file extension(s) to index them. (.txt;.jpg, etc... Separating by semicolon.)
You can simply copy/paste the code into your remote or downloading the .mrc file from HERE
Updated
alias FIndex {
; The [-nx] and [Extension(s)] properties are optional.
; n: Use it if you want to exclude the path which you enter with your command.
; x: Use it if you want to index a specific file extension.
; You can specify one or more file extension(s) to index them. (*.txt;*.jpg, etc... Separating by semicolon.)
var %path = $iif($left($1,1) == -,$iif(x isin $1,$3-,$2-),$1-)
set %IndexerSPath $sdir($mircdir,Select a path to save your output file)
set %IndexCount 0
if (n isin $1) { set %IndexerNoPath %path }
else { unset %IndexerNoPath }
if ($isfile($qt(%IndexerSPath $+ Indexer.txt))) {
var %msg = The file is already exists! Do you want to replace it? $+ $crlf $+ YES $+ $chr(9) $+ = Replace the file. $+ $crlf $+ NO $+ $chr(9) $+ = Append the new info into the file. $+ $crlf $+ CANCEL $+ $chr(9) $+ = Do nothing, just return.
var %q = $input(%msg,nvgq,File is already exists...)
if (%q == $yes) { .write -c $+(",%IndexerSPath,Indexer.txt,") }
elseif (%q == $no) { }
elseif (%q == $cancel) return
}
if (!$1) || (!$isdir($qt(%path))) || (!%IndexerSPath) { echo $color(info) -a *** File Indexer Syntax: /findex [-nx] [Extension] <Path> | return }
var %ext = *.*
if ($left($1,1) == -) && (x isin $1) && (*.* iswm $2) { %ext = $2 }
mWriteInfo -i Path: $qt(%path) $+ $crlf $+ Extension(s): $qt(%ext)
set %IndexTime $ticks
.noop $findfile(%path,%ext,0,0,mWriteInfo $1-)
var %a = 1,%b = $finddir(%path,*.*,0)
while (%a <= %b) {
.noop $findfile($finddir(%path,*.*,%a),%ext,0,0,mWriteInfo $1-)
inc %a
}
mWriteInfo -i Operation succeed in: $calc($calc($ticks - %IndexTime) / 1000) ms. $+ $crlf $+ Indexed files: %IndexCount $+ $crlf $+ E.O.F.
echo $color(info) -a *** Operation succeed and File has been saved to $+(",%IndexerSPath,Indexer.txt,")
unset %Index*
}
alias -l mWriteInfo {
if (!$1) || (!%IndexerSPath) return
if ($1 == -i) {
.write $+(",%IndexerSPath,Indexer.txt,") $str(-,40)
.write $+(",%IndexerSPath,Indexer.txt,") $2-
.write $+(",%IndexerSPath,Indexer.txt,") $str(-,40)
}
else {
if ($len(%IndexerNoPath) > 0) && ($right(%IndexerNoPath,1) != \) { set %IndexerNoPath $+(%IndexerNoPath,\) }
.write $+(",%IndexerSPath,Indexer.txt,") $remove($1-,%IndexerNoPath)
inc %IndexCount 1
}
}