foxJL 当前离线
荣誉版主
梦想种子 当前离线
五级士官
@echo off call :get "%cd%" pause>nul exit :get echo %~n1复制代码
评分人数
TOP
@echo off for %%i in ("%cd%") do echo %%~ni pause复制代码
@echo off set a=%cd: =:% set a=%a:\= % for %%j in (%a%) do (set a=%%j) set a=%a::= % echo %a% pause复制代码
youxi01 当前离线
@echo off set "path=C:\Documents and Settings\All Users" for /l %%i in (1 1 10) do call set "path=%%path:*\=%%" echo %path% pause>nul复制代码
@echo off set "path=C:\Documents and Settings\All Users" set "path=%path: =#%" set "path=%path:\= %" for %%i in (%path%) do set "path=%%i" echo %path:#= % pause>nul复制代码
随风 当前离线
@echo off call :loop "c:\1334 \459sdf fdh8\40958345\aaa.bbb.ccc" echo %a% pause&exit :loop for /f "tokens=1* delims=\" %%a in ("%~1") do ( set a=%%a if not "%%b"=="" call :loop "%%b" ) goto :eof复制代码
@echo off & setlocal enabledelayedexpansion set "path=C:\Documents and Settings\All Users" call :GetTheStr "%path%" echo %res% pause>nul :GetTheStr str set "var=%~1" if not "%var:~-1%"=="\" ( set path=%var:~0,-1% set res=%var:~-1%%res% call :GetTheStr "!path!" )复制代码
fastslz 当前离线
贵宾
@echo off call :get "%cd%.tmp" pause&exit :get echo %~n1复制代码
a5417871 当前离线
一级士官
zqz0012005 (smile)当前离线
假装是个高手
keen 当前离线
@echo off set "a=%cd%" :loop set "v=%a:~0,1%" if "%v%"=="\" set /a n+=1 set a=%a:~1% if "%a%"=="" goto xianshi goto loop :xianshi set /a n+=1 for /f "tokens=%n% delims=\" %%i in ("%cd%") do echo %%i&pause>nul复制代码
lxb1117 当前离线