本帖最后由 smss 于 2021-5-25 18:13 编辑
wimlib生成utf-16 批处理读不到
大神来科普下为什么下面这样可以- @echo off&chcp 65001
- wimlib-imagex.exe info install.esd --xml>1.txt
- for /f "delims=" %%a in ('type 1.txt') do (
- set "str=%%a"
- setlocal enableDelayedExpansion
- if "!str:ARCH=!" neq "!str!" set "str=!str:*<ARCH>=!"
- for /f "delims=<" %%b in ("!str!") do echo;%%b
- endlocal
- )
- pause
复制代码 这样不可以- @echo off&chcp 65001
- for /f "delims=" %%a in ('wimlib-imagex.exe info install.esd --xml') do (
- set "str=%%a"
- setlocal enableDelayedExpansion
- if "!str:ARCH=!" neq "!str!" set "str=!str:*<ARCH>=!"
- for /f "delims=<" %%b in ("!str!") do echo;%%b
- endlocal
- )
- pause
复制代码
|