Page 1 sur 1

connaitre la VERSION WINDOWS en batch

Posté : jeu. 10 déc. 2015 15:12
par chatonhub
Bonjour ,
voici un petit batch

copier coller ceci dans un fichier bloc note enregistré le en se que vous voulez et extension .bat

Code : Tout sélectionner

@echo off
cls
color 5F
REM Detection de l'OS (source reseau-baka.jtkc.org)
ver | find /i "version 6.3." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 8.1-2012R2
ver | find /i "version 6.2." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 8-2012
ver | find /i "version 6.1." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 7-2008R2
ver | find /i "version 6.0." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows Vista-2008
ver | find /i "version 5.1." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows XP
ver | find /i "version 5.2." > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 2003
ver | find /i "Windows 2000" > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 2000
ver | find /i "Windows NT" > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows NT
ver | find /i ">Windows ME" > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows ME
ver | find /i "Windows 98" > nul
if %errorlevel%==0 set $VERSION WINDOWS=Windows 98
ver | find /i "Windows 95" > nul
if %errorlevel%==0 set $VERSIONWINDOWS=Windows 95
 
echo OS : %$VERSIONWINDOWS%
echo.(source du script: http://reseau-baka.jtkc.org/)
echo.
pause
pour ceux qui save pas crée un fichier tellement cela est compliquer
voici un lien

je clique je telecharge

Re: VERSION WINDOWS

Posté : jeu. 10 déc. 2015 15:14
par chatonhub
on peut rajouté pour win 10

Code : Tout sélectionner

ver | find /i "version 10.0.10586" > nul
if %errorlevel%==0 set vwin=Windows 10 1511 10.0.586
ver | find /i "version 10.0.10240" > nul
if %errorlevel%==0 set vwin=Windows 10 RTM 10.0.10240
ver | find /i "version 10.0.9926" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 4 10.0.9926
ver | find /i "version 6.4.9879" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 3 6.4.9879
ver | find /i "version 6.4.9860" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 2 6.4.9860
ver | find /i "version 6.4.9841" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 1 6.4.9841

Re: connaitre la VERSION WINDOWS en batch

Posté : jeu. 10 déc. 2015 15:17
par chatonhub
un dernier peut être plus complet trouver sur la toile d'araignée

voici un petit script pour connaitre sa version de windows de win 95 à win 10 32 ou 64 bits

pour les versions ultérieures il faudra modifier le script

Code : Tout sélectionner

@echo off
cls
set vwin= &set archi= &set sp=
color 0A
title bill morron
ver | find /i "version 10.0.10586" > nul
if %errorlevel%==0 set vwin=Windows 10 1511 10.0.586
ver | find /i "version 10.0.10240" > nul
if %errorlevel%==0 set vwin=Windows 10 RTM 10.0.10240
ver | find /i "version 10.0.9926" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 4 10.0.9926
ver | find /i "version 6.4.9879" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 3 6.4.9879
ver | find /i "version 6.4.9860" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 2 6.4.9860
ver | find /i "version 6.4.9841" > nul
if %errorlevel%==0 set vwin=Windows 10 Technical Preview 1 6.4.9841
ver | find /i "version 6.3.9600" > nul
if %errorlevel%==0 set vwin=Windows 8.1
ver | find /i "version 6.2." > nul
if %errorlevel%==0 set vwin=Windows 8
ver | find /i "version 6.1." > nul
if %errorlevel%==0 set vwin=Windows 7
ver | find /i "version 6.0." > nul
if %errorlevel%==0 set vwin=Windows Vista
ver | find /i "version 5.1." > nul
if %errorlevel%==0 set vwin=Windows XP
ver | find /i "version 5.2." > nul
if %errorlevel%==0 set vwin=Windows 2003
ver | find /i "Windows 2000" > nul
if %errorlevel%==0 set vwin=Windows 2000
ver | find /i "Windows NT" > nul
if %errorlevel%==0 set vwin=Windows NT
ver | find /i ">Windows ME" > nul
if %errorlevel%==0 set vwin=Windows ME
ver | find /i "Windows 98" > nul
if %errorlevel%==0 set vwin=Windows 98
ver | find /i "Windows 95" > nul
if %errorlevel%==0 set vwin=Windows 95
if %PROCESSOR_ARCHITECTURE%==AMD64 (set archi=64bits)
if %PROCESSOR_ARCHITECTURE%==x86 (set archi=32bits)
if defined PROCESSOR_ARCHITEW6432 (set archi=Processus 32 bits sur une plateforme 64 bits)
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDversion >NUL 2>NUL || goto aftertest
for /f "delims=: tokens=*" %%X in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDversion ^| find "Service Pack 3"') do set SP=3
for /f "delims=: tokens=*" %%X in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDversion ^| find "Service Pack 2"') do set SP=2
for /f "delims=: tokens=*" %%X in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v CSDversion ^| find "Service Pack 1"') do set SP=1
:aftertest
if "%sp%"=="" (
set typeOS=%vwin% %archi% sans service pack
goto end
)
set typeOS=%vwin% Service Pack %sp% %archi%
:end
echo %typeOS%
for /f "tokens=*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ^| findstr "ProductName"') do set "version=%%a"
echo Version : %version%
for /f "tokens=*" %%a in ('reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion" ^| findstr "BuildLabEx"') do set "version=%%a"
echo Version : %version%
pause
winver
exit
copier/coller dans le Bloc-notes
enregistrer sous
choisir l'emplacement d'enregistrement
dans type choisir tous les fichiers
donné le nom du fichier ex: Version Win.bat
Enregistrer
faire un essai en double cliquant sur le fichier.bat enregistré


source

Re: connaitre la VERSION WINDOWS en batch

Posté : jeu. 10 déc. 2015 15:38
par chtimi054
Merci mon Chato !

je commence apprecier les chat-thon !!

Re: connaitre la VERSION WINDOWS en batch

Posté : lun. 21 déc. 2015 18:55
par PONPON
merci pour ton partage CHATONHUB

mes il y a plus simple :)

SET CURRENTKEY=HKLM\Software\Microsoft\Windows NT\CurrentVersion
FOR /F "TOKENS=2,*" %%A IN ('reg query "%CURRENTKEY%" 2^>NUL^|FIND /I "ProductName"') DO ECHO # Systeme d'exploitation: %%B
echo.
FOR /F "TOKENS=2,*" %%A IN ('reg query "%CURRENTKEY%" 2^>NUL^|FIND /I "CSDVersion"') DO ECHO # Service Pack: %%B
echo.
FOR /F "TOKENS=2,*" %%A IN ('reg query "%CURRENTKEY%" 2^>NUL^|FIND /I "BuildLabEx"') DO ECHO # Numero de build: %%B
echo.
)
dir /b %windir% | Find "SysWOW64" >nul
if %errorlevel%==0 (
set SYS_32_64=64 Bits
) else (
set SYS_32_64=32 Bits
)

echo # Type du systeme d'exploitation: %SYS_32_64%


exemple :

Code : Tout sélectionner

http://www.jheberg.net/mirrors/version-windows-by-pon2-v10/
:wasntme:

Re: connaitre la VERSION WINDOWS en batch

Posté : lun. 4 janv. 2016 22:47
par chatonhub
Bien vu ponpon

Re: connaitre la VERSION WINDOWS en batch

Posté : mer. 6 janv. 2016 12:51
par sylvestre
:116: Salut @ tous,

moi je me sers:

démarrer ==> executer

Code : Tout sélectionner

winver
@+ :inlove: