- 帖子
- 14
- 积分
- 24
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2018-11-12
|
本帖最后由 380333722 于 2021-9-27 09:27 编辑
::查询我所需要的变量
for /f "eol=" %%g in ('findstr "\windows\tools" path.txt') do (
set t=%%g
setx /m Path "%PATH:!t!=%"
)
在循环中使用变量延迟,还要做替换,是无法实现的,所以需要用 call 来实现。
::查询我所需要的变量
for /f "eol=" %%g in ('findstr "\windows\tools" path.txt') do (call :sub %%g)
goto :eof
:sub
set t=%1
setx /m Path "!PATH:%t%=!" |
|