简体   繁体   English

通过在批处理文件中执行命令来获得多行响应?

[英]Get multiple line response by executing command in batch file?

i am executing a command in a batch file(.bat). 我正在批处理文件(.bat)中执行命令。 This command gives me a multiple line response like 这个命令给了我多行响应

Get String Return value = 1
[Name]
name=john

and i want to get john from this output in a variable but i don't know how to do this. 我想从此输出中获取一个变量中的john,但我不知道该怎么做。

Thanks in advance!! 提前致谢!!

@echo off
for /f "tokens=1,* delims==" %%A in ('command ^| find /i "name="') do set "name=%%B"
echo %name%

?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM