Solved FOR capture and echo output

April 6, 2014 at 16:39:18
Specs: Win 7 X64, Intel i5 (3rd Gen) / 16Gb
Below is some output by DISM. I need to capture the line "Current Edition : HomeBasic" and then echo just it when running the command to get the output.

dism /image:%mountdir% /Get-CurrentEdition

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Image Version: 6.1.7600.16385

Current edition is:

Current Edition : HomeBasic

The operation completed successfully.

See More: FOR capture and echo output

Report •

April 6, 2014 at 19:50:02
✔ Best Answer
dism /image:%mountdir% /Get-CurrentEdition | find "Current Edition :">dism.txt
I'll just wait for "The Rest of the Story" since I'm sure it's coming, Ha ha! If you already
know the output is "Current Edition : HomeBasic", you would not be needing any analysis.

Report •

April 6, 2014 at 21:05:25
I managed a solution on my own but thanks :P

FOR /F "tokens=2 delims=:" %%A in ('!DISM! /image:!mountdir! /Get-CurrentEdition') do set currentedition=%%A

Well the above good worked but not anymore. :(

Well the above evolved into:

For /F "Tokens=1,2* Delims=: " %%A In (
'"!DISM!" /Image:!mountdir! /Get-CurrentEdition') Do (
If %%A Equ Version Set VER=%%B
If %%B Equ Edition Set currentedition=%%C

Now to get it to grab the second version instead of the first one.

message edited by Phrey89

Report •

Related Solutions

Ask Question