@echo off
for /f "delims=" %%a in ('ver') do set version=%%a
echo %version%
Output:
Microsoft Windows [Version 6.1.7600]
Example 2: Set Windows version to a variable
@echo off
for /f "tokens=4" %%a in ('ver') do set version=%%a
for /f "delims=] tokens=1" %%a in ("%version%") do set version=%%a
echo %version%
Output:
6.1.7600
More information: For
No comments:
Post a Comment