Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
@echo off
setlocal EnableExtensions
setlocal EnableDelayedExpansion
for /f "usebackq" %%i in (`wmic os get version ^| findstr /b "[0-9].*"`) do (
set "winver=%%i"
set "winver=!winver:~0,3!
)
echo %winver%
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.