2013koko 当前离线
列兵
TOP
cutebe 当前离线
上尉
评分人数
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复制代码
@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"复制代码
went 当前离线
少校
@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复制代码
@echo off & cd /d "%~dp0"复制代码