Skip to content

Instantly share code, notes, and snippets.

@lukecamilo
Created May 22, 2019 16:44
Show Gist options
  • Save lukecamilo/58edaec15d513a9e0f3ef5b861a4bc23 to your computer and use it in GitHub Desktop.
Save lukecamilo/58edaec15d513a9e0f3ef5b861a4bc23 to your computer and use it in GitHub Desktop.
:CHEQUEASERVER
REM Se fija que sea windows XP, Vista, 7 u 8.
REM Si no es, no instala
systeminfo | find "Microsoft Windows" > %TEMP%\osname.txt
FOR /F "usebackq delims=: tokens=2" %%i IN (%TEMP%\osname.txt) DO set vers=%%i
echo %vers% | find "Windows 7" > nul
if %ERRORLEVEL% == 0 goto SIGUE
echo %vers% | find "Windows Vista" > nul
if %ERRORLEVEL% == 0 goto SIGUE
echo %vers% | find "Windows XP" > nul
if %ERRORLEVEL% == 0 goto SIGUE
echo %vers% | find "Windows 8" > nul
if %ERRORLEVEL% == 0 goto SIGUE
REM Si llego hasta aca abajo, no es
REM win xp, vista, 7 ni 8. Por descarte
REM es windows server, y no se instala.
:FIN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment