结束了也发发代码:
- @echo off&setlocal enabledelayedexpansion
- Title 任意输入用"_"号分隔,不取开尾 →ψ疯行天魔Ф
- set T=str_bb_cc_0010
- set /p T=任意输入用"_"号分隔,不取开尾:
- set "T=!T:\=\!"
- set "T=!T:_=\!"
- for /f "tokens=* delims=" %%a in ('echo c:\%T%') do (
- for /f "tokens=1,2,* delims=\" %%b in ('echo %%~dpa') do (
- set "TT=%%d"
- set "TT=!TT:\=_!
- set "TT=!TT:\=\!
- echo !TT!))
-
- pause
- exit
复制代码
错误点是_号都当分隔号处理掉...
所以不能好好处理有_号的字符内容
[ 本帖最后由 qq106942397 于 2010-8-16 21:29 编辑 ] |