@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
:WinNT
perl -x -S %0 %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
if errorlevel 1 goto script_failed_so_exit_with_non_zero_val 2>nul
goto endofperl
@rem ';
#!/usr/local/bin/perl -w
#line 15
use strict;
use File::Find;
my $path = ".";
find(\&process, $path);
sub process
{
my $dir = $File::Find::dir;
$dir =~ s/^\.\///;
$dir =~ s/\//\\/g;
print "'$_' is in the directory of".$dir."\\".$_,"\n";
}
exit 0;
__END__
:endofperl
1 复制上述代码,存储到一个新批处理文件中,如rlist.bat
2 把rlist.bat拷备到需要列出所有文件的目录下
3 通过命令行窗口执行rlist.bat > flist.txt,文件列表就会存储到重定向文件flist.txt中
感谢那个哥们的blog,嘿嘿!