SQL Server 2005 upgrade service pack via command line
I have used below in past to upgrade all instances running sql 2005 to SP4. Just put this in a .bat file 

@echo off
set hour=%time:~0,2%
if "%hour:~0,1%"==" " set hour=0%time:~1,1%
echo      Started at %date% %time%
SQLServer2005SP4-KB2463332-x64-ENU.exe /allinstances /quiet

echo      Completed at %date% %time%