
CODE: [Copy to clipboard]@echo off
set "file=c:\ab c\def\gh\cd"
call :getpath "%file%"
echo 共有:%count%层
pause>nul
:getpath
for /f "delims=\ tokens=1,*" %%i in ("%~1") do (
if "%%i"=="%~1" goto :eof
set/a count+=1
call :getpath "%%j")
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |