This project is read-only.
1

Closed

Handle Windows Vista and above

description

I think this should work for some basic version handling.
 
REM http://ss64.org/viewtopic.php?id=879
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)
 
REM Echo Major version: %_major% Minor Version: %_minor%.%_build%
 
...
 
REM seccheck.exe not compatible with Vista or above
if "%_major%">="6" goto compromised_stage
 
ECHO Running seccheck on %COMPUTERNAME%.
now.exe [Running seccheck on %COMPUTERNAME%.] >> %2:\Livecap_%COMPUTERNAME%\MIR-ROR.log
seccheck > %2:\Livecap_%COMPUTERNAME%\seccheck.log
move SecCheckLog.txt %2:\Livecap_%COMPUTERNAME%\SecCheckLog.txt
 
:compromised_stage
ECHO.
ECHO The following stage assesses for compromised code or settings.
ECHO.
 
...
Closed Apr 12, 2012 at 3:19 AM by RussMcRee

comments

jkrev wrote Jan 20, 2010 at 4:29 PM

This fix works with one minor change. I had to change this fix on the version compare line from:
 if "%_major%">="6" goto compromised_stage
to
if "%_major%" GEQ "6" goto compromised_stage
for this to work on Windows 7 Enterprise.

ubahmapk wrote Jun 3, 2010 at 7:33 PM

Another method to accomplish a similar goal:

(to be included immediately after 'systeminfo' is run)

-=-=-=-=-=-=-=- BEGIN -=-=-=-=-=-=-=-=-=-
REM **************************
REM * OS Detection Function *
REM **************************

findstr /i xp %LOGS%:\Livecap_%COMPUTERNAME%\systeminfo.log >nul
IF %ERRORLEVEL% == 0 SET OSNAME= XP
findstr /i vista %LOGS%:\Livecap_%COMPUTERNAME%\systeminfo.log >nul
IF %ERRORLEVEL% == 0 SET OSNAME= Vista
findstr /i windows.7 %LOGS%:\Livecap_%COMPUTERNAME%\systeminfo.log >nul
IF %ERRORLEVEL% == 0 SET OSNAME= Vista

ECHO.
ECHO ****************************
ECHO OS Detected as: %OSNAME%
ECHO ****************************
ECHO.
-=-=-=-=-=-=-=- END -=-=-=-=-=-=-=-=-=-=-=-

While this method doesn't (currently) include the major+minor versions, that information has not been needed in our usage.

wrote Apr 12, 2012 at 3:19 AM

wrote Feb 13, 2013 at 9:09 PM

wrote May 16, 2013 at 2:09 AM