a.bat的内容为:复制代码
- %windir%
运行a.bat,显示内容为:复制代码
- @echo off
- cd /d %~dp0
- type a.txt
- pause
但我想要显示内容为%windir%的变量值,也就是复制代码
- %windir%
,a.txt内容不能变,要怎么用bat实现?复制代码
- C:\Windows
复制代码
- @echo off
- for /f "delims=" %%i in ('type "a.txt"') do (
- call echo %%i
- )
- pause
欢迎光临 批处理之家 (http://bbs.bathome.net/) | Powered by Discuz! 7.2 |