I am writing a batch script which needs to compare registry data value string with ±3 days of todays date.
My REG QUERY
returns a value:
HKEY_LOCAL_MACHINESoftwareWow6432NodeKasperskyLabComponents3411031.0.0.0StatisticsAVState
Protection_BasesDate REG_SZ 27-08-2018 08-53-00
I need to output to a file, depending if it is within the range or not.
Script:
REG QUERY "HKLMSoftwareWow6432NodeKasperskyLabComponents3411031.0.0.0StatisticsAVState" /v "Protection_BasesDate" | Find "2018"
IF %ERRORLEVEL% == 1 goto end
If %ERRORLEVEL% == 0 goto makefile
:makefile
echo "{"product":"Override Antivirus","running":true,"upToDate":true}" > c:ProgramDataCentraStageAEMAgentantivirus.json
:end
@exit
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…