Skip to content

Instantly share code, notes, and snippets.

@nerflad
Created February 14, 2017 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nerflad/97e3fe8aca2aa09f6d44520e33f0ecf8 to your computer and use it in GitHub Desktop.
Save nerflad/97e3fe8aca2aa09f6d44520e33f0ecf8 to your computer and use it in GitHub Desktop.
@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