Funcion GetOS

Iniciado por ANTRAX, Julio 18, 2011, 09:34:15 PM

Tema anterior - Siguiente tema

0 Miembros y 1 Visitante están viendo este tema.

Código: dos
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:GetOS os
::
:: By:   Ritchie Lawrence, 2003-09-18. Version 1.0
::
:: Func: Returns the O/S version; NT40, 2000, 2002 or 2003.
::       For NT4/2000/XP/2003.
::
:: Args: %1 var to receive O/S version (by ref)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
setlocal ENABLEEXTENSIONS & set "cmd=net config work^|findstr/b /c:"Soft""
for /f "tokens=1-2 delims=." %%a in ('%cmd%') do (
  for %%z in (%%a%%b) do set o=%%z)
endlocal & set "%1=%o:40=NT40%" & (goto :EOF)
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::