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..
Code: for /f "skip=2 tokens=3 delims= " %%i in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v EditionID') do set edition=%%i
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
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%
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...