First post here, so apologies if I don\'t do this quite right.
I\'m trying to output the OS version on a remote Windows PC, but I keep getting unwanted data. Execut
@echo off for /f "usebackq delims= skip=1" %%a in (`wmic OS get caption 2^>nul ^| findstr "."`) do set caption=%%a for /f "usebackq delims=" %%a in (`echo %caption%`) do set caption=%%a set "caption=%caption:~0,-1%" echo Caption=[%caption%]