本帖最后由 watermark 于 2012-2-14 19:27 编辑
忙呀, 差点忘记了!
贴一份能证明标题的代码:- @echo off
- setlocal enabledelayedexpansion
- set tsr=!*
- if defined tsr (
- for /f "tokens=*" %%i in ("!tsr!") do (
- for %%a in (%%i) do (
- cd /d "%~dp0"
- set filea=%%~a
- set exta=%%~xa
- set name=%%~na
- set patha=%%~dpa
- set folder=!name!_!exta:~1!
- set pathb=!patha!!folder!
- call :action
- pause>nul
- )
- )
- )
-
- :action
- echo "%filea%"
- echo "%exta%"
- echo "%folder%"
- md "%folder%"
- echo "%cd%"
- cd "%pathb%"
- echo on
- echo "%cd%"
- @echo off
- goto eof
-
- :eof
复制代码 这份代码不能直接绕过(abc)&(xyz)形式的限制, 但拖入别的文件能枚举同目录下任何含特殊字符的文件. |