As said by op @dbenham There are multiple ways to handle this:
- In command-line:
for /f usebackq^tokens^=4delims^=^<^> %G in (`wmic volume where "Driveletter like '%C%'" get label /format:xml ^| find "VALUE"`)do @echo/%G
- In bat/cmd file:
@echo off
for /f usebackq^tokens^=4delims^=^<^> %%G in (`wmic volume where "Driveletter like '%C%'"'%%C%%'" get label /format:xml ^| find "VALUE"`)do echo/%%G
Change the formatting to xml and the output will change the encode, after that filter to obtain the desired value in one line and on for
loop without additional characters and/or linebreaks.