I'm entering this line:
wmic /OUTPUT:D:\DriverVersion.txt path win32_VideoController get driverversion
The txt file has two lines in it:
VariableValue
XX.XXX.XXX.XX.X
But I don't want VariableValue
to get into output. I want simply get the output (XX.XXX.XXX.XX.X
)
How can I do this?
Answer
You could try the following:
(@for /F "delims=" %I in ('wmic path Win32_VideoController get DriverVersion /VALUE') do @for /F "tokens=1* delims==" %J in ("%I") do @echo/%K) > "D:\DriverVersion.txt"
But this converts the Unicode output data to ASCII/ANSI.
If you want to use this code within a batch-file, ensure to double all %
-signs.
No comments:
Post a Comment