0

The output of the below code only takes the first word of each line. I want to see if the disk DYN or not.

    @echo off
    diskpart /s test9.txt

    for /f %%i in ('diskpart /s test9.txt') do echo %%i 

Code Outputs: Disk

[Dashed Lines]

Disk

How do I get the whole line?

4

2 回答 2

3

"tokens=*"删除前导空格,这不是这里的问题,但出于一般原因使用更好:

for /f "delims=" %%i in ('diskpart /s test9.txt') do echo %%i 
于 2013-07-18T20:22:07.617 回答
0
for /f "tokens=*" %%i in ('diskpart /s test9.txt') do echo %%i 
于 2013-07-18T19:29:01.950 回答