我正在尝试使用以下批处理文件在注册表中搜索键值,但返回的错误级别不一致:
@Echo off
setlocal
set PATHFIX=%CD%
set LOGFILE=%SYSTEMDRIVE%\windows\IA\%COMPUTERNAME%-ISPA_Windows_7_STIG_V1R9_27_Jul_2012-%DATE%.txt
echo Log file name will be %LOGFILE%
echo Security Template logfile for %COMPUTERNAME% > %LOGFILE%
echo -- >> %LOGFILE%
for /f "delims=*" %%i in ('time /t') do set TIME=%%i
echo Date run: %DATE% >> %LOGFILE%
echo Time run: %TIME% >> %LOGFILE%
echo -- >> %LOGFILE%
echo Windows_7_STIG_V1R9 27 Jul 2012 >> %LOGFILE%
echo =============================================================================================== >> %LOGFILE%
FOR /F "tokens=1,2,3,4,5,6,7,8,9 delims= " %%F IN (WINDOWS_7_V1R9.txt) DO (
reg query "%%F" /v "%%H" /t "%%I" | Find "%%J"
IF not ERRORLEVEL 1 (
echo %%G Compliant
echo %%G %%K Compliant %%M>> %LOGFILE%
echo -- >> %LOGFILE%
) ELSE (
echo %%G Non-Compliant
echo %%G %%K Non-Compliant %%F\%%H %%I %%J >> %LOGFILE%
echo -- >> %LOGFILE%
)
)
echo -- >> %LOGFILE%
:PATCHES_COMPLETE
for /f "delims=*" %%i in ('time /t') do set TIME=%%i
echo -- >> %LOGFILE%
echo ISPA-STIG for %COMPUTERNAME% completed at: %TIME% >> %LOGFILE%
pause
exit
文本文件设置如下:
HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System V-1075 ShutdownWithoutLogon REG_DWORD 0x1 ECSC-1 SV-25111r1_rule 显示关机按钮
任何帮助将不胜感激。