2013koko 当前离线
列兵
TOP
went 当前离线
少校
@echo off & cd /d "%~dp0"复制代码
@echo off if "%~1"=="" echo,请拖放文件夹到本文件上 &pause&exit :loop echo %~1 ( for /r "%~1" %%i in (*) do ( call set "p=%%~i" call set "p=%%p:%~1\=%%" call echo %%p%% ) )>"%~nx1.txt" echo %~nx1.txt echo done. echo --------------- shift /1 if not "%~1"=="" goto :loop pause&exit复制代码
cutebe 当前离线
上尉
@echo off setlocal enableDelayedExpansion set "str=%~1" set dn=1 :snlp if "!str:*\=!" neq "" ( set/a dn+=1 set "str=!str:*\=!" if "!str:*\=!" neq "!str!" goto :snlp ) setlocal disableDelayedExpansion (for /f "tokens=%dn%* delims=\" %%q in ('dir/a-d/b/s/og "%~1"')do echo %%r)>"%~dp0%~nx1_filelist.txt"复制代码
评分人数
newswan 当前离线
@echo off setlocal enableDelayedExpansion for %%a in (%*) do ( call :f1 %%a ) goto :END :f1 for /f "usebackq" %%a in (`Powershell -c "'%1'.Length"`) do ( set /a n=%%a+1 ) for /f "usebackq delims=" %%a in (` dir /a/s/b/on %1 `) do ( set str=%%~a set str=!str:~%n%! echo !str! ) goto :eof :END pause复制代码
dir/a-d/b/s/og "%~1">"%~dp0%~n1_filelist.txt" set "dirstr=%~1\" sed -i "s/^%dirstr:\=\\%//" "%~dp0%~n1_filelist.txt"复制代码
@echo off setlocal enableDelayedExpansion for /f "usebackq" %%a in (`Powershell -c "'%1'.Length"`) do ( set /a n=%%a+1 ) for /f "usebackq delims=" %%a in (` dir /a/s/b/on %1 ^| findstr /v "EBWebView" `) do ( set str=%%~a set str=!str:~%n%! echo !str! ) > list.txt复制代码