If you are making a hard disk drive image, you will wish to follow the instructions regarding modifying the volume boot record for the partition. Thanks to jaclaz for this volume boot record information.
While not 100% exactly what a Recovery Console installation gives you, it's pretty close. You should most likely use the attachment to this post, rather than copying and pasting from the code-box, since copying from the code-box with some browsers mightn't handle spaces nicely.
At some point I will try to port this as a Unix or Linux script.
@(/* 456789A123456789A123456789A123456789A123456789A123456789A123456789A123456789 * ÉÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍÍÏÍÍÍÍÍÍÍÍ» * º Each line of this file is optimally formatted for 79 columns. º * º Best viewed from a command-line interface ^(a DOS box^) with the º * º 'type' command or in Windows Notepad with the Terminal font. º * ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¶ * º Programmed by Shao Miller @ 2010-05-13_20:31 º * ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¼ *//* For debugging */set DBG=/* To help with commenting. Heh */set #= ^> NUL 2^>^&1 ^&^& ^(set ##= ^) ^> NUL 2^>^&1/* To suppress standard output and error messages */set _= ^> NUL 2^>^&1/* A message, possibly blank */set @=echo./* Quit the program */set Q=goto :eof/* Simply to align the "splash screen"set L= /* Oh, and we should set this */echo off) > NUL 2>&1/* %#% * This is where the batch file lives */ %##%call :_get_dir "%cd%"/* %#% * Are we in our own subdir? */ %##%if not "%_dir%"=="MkCmdCons" ( /* Nope. Make the subdir and copy us into it */ %_% mkdir MkCmdCons %_% copy /y "%~nx0" mkcmdcons %_% cd mkcmdcons /* Run us again with no return */ %_% "%~nx0" %Q% )/* %#% * We're in our own subdir. Delete any previously run copy */ %##%del /f ..\"%~nx0" %_%/* %#% * Tell the user something about the program */ %##%title Windows XP/2003 Recovery Console "Builder"%@% %@% Windows XP/2003 Recovery Console "Builder" %L%Shao Miller, 2010%@% %@% %@% %@% Performing Dynamic Update%@% Checking for the latest updates.%@%%@% Dynamic Update is:%@% -^> Connecting to Microsoft%@% -^> Downloading software%@% -^> Just kidding!%@%%@%/* %#% * Check the Windows XP/2003 source */ %##%set _src=%1if "%_src%"=="" ( %@% No source given on command-line. ^(Example: \XPSP2\I386^) %@% set /p _src= Enter the path to the Windows XP/2003 source: %@% )%@% Checking for %_src%\TXTSETUP.SIF...if not exist %_src%\txtsetup.sif ( %@% Not found! %@% %Q% )%@% Found.%@%/* %#% * Build the keyboard .DLL list */ %##%%@% Building the keyboard .DLL list...type %_src%\txtsetup.sif | findstr /i KBD | findstr /i .DLL,2 > KBD_DLL.txt%@% > KBD_DLL2.txtfor /f "tokens=3" %%a in (KBD_DLL.txt) do ( %@%%%a ) >> KBD_DLL2.txt%@% > KBD_DLL3.txtfor /f "delims=," %%a in (KBD_DLL2.txt) do ( %@%%%a ) >> KBD_DLL3.txt%@%/* %#% * Build the list of other files */ %##%%@% Building the list of other files...type KBD_DLL3.txt > files1.txttype \xpsp2\i386\txtsetup.sif | findstr = | findstr _, >> files1.txttype \xpsp2\i386\txtsetup.sif | findstr = | findstr ,_ | findstr /v ,_x | findstr /v /i .dll >> files1.txt/* %#% * Sort the list alphabetically */ %##%type files1.txt | sort > files2.txt/* %#% * Take the first word of each line, which is the file name */ %##%%@% > files3.txtfor /f %%a in (files2.txt) do ( %@%%%a ) >> files3.txt/* %#% * Strip off the last character from each filename */ %##%%@% > files4.txtfor /f %%a in (files3.txt) do ( call :_wild %%a ) >> files4.txt%@% > wild_list.txtfor /f %%a in (files3.txt) do ( call :_wild %%a ? ) >> wild_list.txt%@% Done.%@%/* %#% * Copy files */ %##%mkdir Root %_%mkdir root\CmdCons %_%mkdir root\cmdcons\System32 %_%%@% Copying files...for /f %%a in (wild_list.txt) do ( copy /y %_src%\%%a root\cmdcons %_% )copy /y %_src%\ntdetect.com root %_%copy /y %_src%\setupldr.bin root\ntldr %_%copy /y %_src%\txtsetup.sif root\cmdcons %_%copy /y %_src%\auto???.exe root\cmdcons %_%for /l %%a in (1,1,6) do ( %@%> root\cmdcons\disk10%%a )%@%[SetupData]> root\cmdcons\WinNT.SIF%@%SetupSourceDevice = "">> root\cmdcons\WinNT.SIFcopy /y %_src%\ntdll.dll root\cmdcons\system32 %_%copy /y %_src%\system32\smss.exe root\cmdcons\system32 %_%%@% Done.%@%%@% If you are creating an HDD image, please remember to overwrite the%@% appropriate bytes of the partition's boot record (NOT the MBR) with%@% bytes 0x3 through 0xA as "cmdcons\0". That is, the fourth through%@% 11th bytes. '\0' is an ASCII NUL character.%@%%@% You might now enjoy something like: xcopy /e /h root g:\%@%%Q%/* %#% * Set _dir to the filename of the passed string, * without the extension. This function is called * with the current directory, up above */ %##%:_get_dirset _dir=%~n1%Q%/* %#% * Strip the last character off a filename. * Optionally append a string afterwards */ %##%:_wildset _file=%1echo %_file:~0,-1%%2%Q%
- Shao Miller