I haven't written a batch file for a few years, and I've forgotten how to do this. My code displays the OS Name.
Code:
systeminfo | findstr /B /C:"OS Name"
It then says
OS Name: Microsoft Windows 8.1
(there is a huge space in between)
I want it to display the OS Name without actually outputting "OS Name:" and have the huge space. Any help is greatly appreciated.
Here's one way:
@echo off
for /f "tokens=1,2,*" %%a in ('systeminfo ^| findstr /B /C:"OS Name" ') do echo "%%c"