aGerman wrote: ↑05 Nov 2019 18:13
FOR /F loops will remove empty lines for you before they get written to the file.
Code: Select all
>>%OUTPUT% (for /f "delims=" %%i in ('wmic logicaldisk get deviceid^,volumename^,description') do for /f "delims=" %%j in ("%%i") do echo %%j)
>>%OUTPUT% echo(
>>%OUTPUT% (for /f "delims=" %%i in ('echo list volume^|diskpart') do echo %%i)
The second line adds an empty line between the outputs of the two commands.
Steffen
Thank you for that. I would never have worked that out in a million years!
I wish I had learnt programming in the past [too old now]!
The only thing that I have outstanding on this now is extracting two pieces of information. I have managed to do it using
systeminfo but I was really trying to do it using
wmic. I have spent quite a bit of the day on it as I am off work waiting for two operations!
Code: Select all
systeminfo 2>NUL | FindSTR /b /C:"OS Configuration": >> %OUTPUT%
systeminfo 2>NUL | FindSTR /b /C:"System Locale": >> %OUTPUT%
Which produces . . .
Code: Select all
OS Configuration: Standalone Workstation
System Locale: en-gb;English (United Kingdom)
I have noticed that using
systeminfo takes quite a while as opposed to using
wmic.
I just can't get this data from
wmic!
Thanks in advance.