CODE: [Copy to clipboard]
@echo off
attrib -s -h -r C:\boot.ini
del *boot.x 2>nul
findstr /i /n ".*" C:\boot.ini >boot.x
setlocal enabledelayedexpansion
for /f "tokens=1,2,3* delims==/" %%a in ('type boot.x^|find /i "/fastdetect"^|find /v "2000"') do (
set osname=%%b
>>newboot.x echo %%a="XXXXXXXX !osname:~1!/%%c=%%d
)
for /f "tokens=1,2* delims==/" %%a in ('type boot.x^|find /i "/fastdetect"^|find /i "2000"') do (
set osname=%%b
>>newboot.x echo %%a="XXXXXXXX !osname:~1!/%%c
)
for /f "tokens=1 delims=:" %%i in (newboot.x) do call set str=%%str%% %%i
findstr /v "%str%" boot.x>tmpboot.x
copy tmpboot.x + newboot.x boot.x
del newboot.x
for /l %%a in (1,1,14) do findstr /i "%%a:" boot.x>>newboot.x
del boot.x
for /f "delims=" %%i in ('type newboot.x^|findstr "1: 2: 3: 4: 5: 6: 7: 8: 9:"') do (
set var=%%i
>>boot.x echo.!var:~2!
)
for /f "delims=" %%i in ('type newboot.x^|findstr "10: 11: 12: 13: 14:"') do (
set var=%%i
>>boot.x echo.!var:~3!
)
move /y boot.x C:\boot.ini
attrib +s +h +r C:\boot.ini
del *boot.x 2>nul
pause
CODE: [Copy to clipboard]
@echo off
for /f "skip=4 tokens=1,2* delims==/" %%i in (C:\boot.ini) do (
Set StrA=%%i
Set StrB=%%j
Set StrC=%%k
Call :EchoBoot
)
pause>nul
exit
:EchoBoot
if "%StrC%"=="" goto :NoC
echo %StrA%="Slore + %StrB:~1,-1% + %date%" /%StrC%
goto :EBend
:NoC
echo %StrA%="Slore + %StrB:~1,-1% + %date%"
:EBend