[SOLVED] How to determine which version of win10 are u using? via batch file

Discussion in 'Windows 10' started by ege914, Nov 7, 2016.

Thread Status:
Not open for further replies.
  1. ege914

    ege914 MDL Member

    Jun 29, 2015
    124
    25
    10
    #1 ege914, Nov 7, 2016
    Last edited by a moderator: Nov 11, 2016
    hi i am using


    setlocal
    for /f "tokens=4-5 delims=. " %%i in ('ver') do set VERSION=%%i.%%j
    if "%version%" == "6.3" goto Win81
    if "%version%" == "6.2" goto Win8
    if "%version%" == "6.1" goto Win7
    if "%version%" == "6.0" goto Winvista
    if "%version%" == "10.0" goto Win10

    :win10




    but i cant identify if windows 10 is ltsb or other? because i am creating some batch file to install old calc.exe to windows 10 but not to ltsb version..
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    7,547
    23,973
    240
    #2 abbodi1406, Nov 7, 2016
    Last edited by a moderator: Apr 20, 2017
    Code:
    for /f "skip=2 tokens=3 delims= " %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID') do set edition=%%i
     
  3. farukkaraca

    farukkaraca MDL Member

    Sep 27, 2009
    171
    96
    10
    #3 farukkaraca, Nov 7, 2016
    Last edited: Nov 7, 2016
    Hi Ege914 ;

    Maybe you can try this to determine it is Enterprise or not

    FOR /F "tokens=3" %%A in ('reg query "HKLM\software\Microsoft\windows NT\CurrentVersion" /v EditionID') Do (Set Edition=%%A)
    If %Edition% NEQ Enterprise (Your command here for installing oldcalc.exe)

    Edit ; Sorry Abbodi1406. I saw your post after i sent my post
     
  4. SAM-R

    SAM-R MDL Guru

    Mar 21, 2015
    2,518
    1,526
    90
    Why not just look in System Information :confused::confused::confused::confused::confused:
     
  5. farukkaraca

    farukkaraca MDL Member

    Sep 27, 2009
    171
    96
    10
    He wants to do it with command prompt. maybe he wants to use it with setupcomplete.cmd
     
  6. Snuffy

    Snuffy MDL Expert

    Jan 7, 2008
    1,194
    594
    60
    Here is what i use: anyway one
    ----------------------
    @echo off

    color 1E

    if exist "%Windir%\Sysnative\sppsvc.exe" set SysPath=%Windir%\Sysnative
    if exist "%Windir%\System32\sppsvc.exe" set SysPath=%Windir%\System32
    echo ************************************************************
    echo *** Windows Status ***
    echo ************************************************************
    cscript /nologo %SysPath%\slmgr.vbs /dli
    ----------------------------------------------
    ************************************************************
    *** Windows Status ***
    ************************************************************

    Name: Windows(R), EnterpriseS edition
    Description: Windows(R) Operating System, OEM_COA_NSLP channel
    Partial Product Key: MDWWW
    License Status: Licensed
    -------------------------------------
    little more info:
    ----------------------
    @echo off
    :color 1F
    color 1E

    if exist "%Windir%\Sysnative\sppsvc.exe" set SysPath=%Windir%\Sysnative
    if exist "%Windir%\System32\sppsvc.exe" set SysPath=%Windir%\System32
    echo ************************************************************
    echo *** Windows Status ***
    echo ************************************************************
    cscript /nologo %SysPath%\slmgr.vbs /dli


    Echo off

    Setlocal
    :: Get windows Version numbers
    For /f "tokens=2 delims=[]" %%G in ('ver') Do (set _version=%%G)
    For /f "tokens=2,3,4 delims=. " %%G in ('echo %_version%') Do (set _major=%%G& set _minor=%%H& set _build=%%I)
    Echo Major version: %_major% Minor Version: %_minor%.%_build%
     
  7. Tiger-1

    Tiger-1 MDL Guru

    Oct 18, 2014
    2,898
    3,025
    90
    @SAM-R or still via cmd winver is more easy
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. Bezalel

    Bezalel MDL Member

    Apr 30, 2012
    230
    23
    10
    Why not just check if the classic calculator is installed?
     
  9. Flipp3r

    Flipp3r MDL Expert

    Feb 11, 2009
    1,517
    650
    60
    #9 Flipp3r, Nov 8, 2016
    Last edited by a moderator: Apr 20, 2017
    You can use wmic in your batch:
    Code:
    wmic OS get Caption,OSArchitecture,Version
    You can use it to retrieve your product key from the MSDM table:
    Code:
    wmic path softwarelicensingservice get OA3xOriginalProductKey
    Lots of info can be found...
     
  10. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,285
    1,716
    120
    redacted :(:(
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  11. ege914

    ege914 MDL Member

    Jun 29, 2015
    124
    25
    10
    Thanks for everything and abodis version is enough
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...