本帖最后由 /zhqsystem/zhq 于 2015-11-3 23:09 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1,* delims=:" %%i in ('type "%~dp0\测试文本.txt"') do (
- set "name_drive=%%i"
- set "name_drive=!name_drive:~-1,1!
- for /f "tokens=1,* delims=[" %%k in ("!name_drive!:%%j") do (
- for /f "delims=" %%l in ("%%~fk") do (
- echo=%%l
- )
- )
- )
- pause
复制代码
|