本帖最后由 gucong 于 2010-2-26 03:28 编辑
网上有不少替换XP的开机画面的方法,经过测试,发现有时会使系统无法启动。利用AutoIt则可以安全的替换它。
完成后效果:
AutoIt方式实现方法代码:SplashTextOn("XP to VISTA", "正在更改开机画面")
RunWait(@SystemDir & "\reshacker.exe -addoverwrite ntoskrnl.exe ,Kernel.exe ,Kernel.res ,,,",@SystemDir)
$boot = IniReadSection("C:\boot.ini", "operating systems")
FileSetAttrib("C:\boot.ini","-RASH")
For $i = 1 To $boot[0][0]
If StringInStr($boot[$i][1],"Microsoft Windows XP") Then
$boot[$i][1]=StringReplace($boot[$i][1],"Microsoft Windows XP Home","Microsoft Windows Vista Ultimate")
$boot[$i][1]=StringReplace($boot[$i][1],"Microsoft Windows XP Professional","Microsoft Windows Vista Ultimate")
If FileExists(@SystemDir & "\Kernel.exe") Then $boot[$i][1]=$boot[$i][1] & " /Kernel=Kernel.exe"
IniWrite("C:\boot.ini", "operating systems", $boot[$i][0], $boot[$i][1])
EndIf
Next
FileSetAttrib("C:\boot.ini","+RASH")
批处理方式实现方法代码:@echo off
reshacker.exe -addoverwrite %windir%\system32\ntoskrnl.exe ,%windir%\system32\Kernel.exe ,Kernel.res ,,,
if not exist %windir%\system32\kernel.exe goto :eof
cd /d %SystemDrive%
if not exist boot.ini echo Not found boot.ini!&goto :eof
if exist %temp%\boot.new del /f /a %temp%\boot.new
find/i "/kernel=" boot.ini>nul && echo Modified boot.ini! && goto :eof
for /f "delims=" %%l in (boot.ini) do (
echo.%%l | find/i "/fastdetect" >nul && echo %%l /kernel=kernel.exe || echo %%l
)>>%temp%\boot.new
find/i "/kernel" %temp%\boot.new>nul 2>nul
if errorlevel 1 echo Fail to parse boot.ini!&goto :eof
attrib -s -h -r boot.ini
copy boot.ini %temp%\boot.bak>nul&&echo Pass to backup boot.ini.
copy %temp%\boot.new boot.ini>nul 2>nul
find/i "/kernel" boot.ini>nul 2>nul
if not errorlevel 1 echo Pass to wrtie boot.ini.
if errorlevel 1 copy %temp%\boot.bak boot.ini>nul & echo Fail to wrtie boot.ini!
attrib +s +h +r boot.ini
del %temp%\boot.new & del %temp%\boot.bak
|