Jump to content











Photo
- - - - -

Recovery Console XP/2003 "Builder"


  • Please log in to reply
3 replies to this topic

#1 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 14 May 2010 - 04:53 AM

In the code-box below, you will find a MkCmdCons.bat file which should build a directory structure and populate it with the appropriate files from an XP/2003 installation source. What you end up with should be sufficient for booting the Recovery Console.

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%

Enjoy.

- Shao Miller

Attached Files



#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 14 May 2010 - 07:49 AM

:cheers:

:cheers:

To recap:
Sha0 posted two excellent tutorials about Recovery Console:
http://www.boot-land...?...c=10073&hl=
http://www.boot-land...?...c=11084&hl=
which make use - if desired - of his RAMDISK driver WinVblock, thus removing the need for the Server 2003 SP1 files and thus eliminating the need to download the whole SP and bypassing any problem about the License of them.

There are two other "main" threads on boot-land about Recovery Console:
http://www.boot-land...?showtopic=2254
http://www.boot-land...?showtopic=5316
full of examples, info, other possible methods, including semiautomated or automated builders for it.

If anyone is interested in the matter, most if not all points in this list:

Next steps:
1) Remove "oldish" unneeded drivers
2) Minimize TXTSETUP.SIF/TXTSETUP.SI_ from 461 Kb/74 Kb
(I made a test where TXTSETUP.SIF/TXTSETUP.SI_ were 8 Kb/3 Kb, but it needs a few betterings)
3) find a "modular" way to remove/add drivers and remove unused keyboard mappings
4) find a way to avoid the 5 seconds delay for different keyboard layout choosing
5) find the smallest possible image size and "better" filesystem for it
6) automate the whole thing via batch
7) some other semi-random ideas that may come out

Anyone willing to help for any of the above? :(

jaclaz


still are without definite/usable/documented answers.



:cheers:
Wonko

P.S:: ...and another just posted approach using nlite and firadisk:
http://www.boot-land...?...=5041&st=60

#3 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 14 May 2010 - 12:49 PM

Just a slight correction: The Recovery Console via PXE, TFTP, SMB method does not require any RAM disks at all; neither WinVBlock nor a RAM disk driver from Windows Server 2003 SP1. Thanks for keeping related things together as always, Wonko the Sane. :cheers:

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 16 October 2012 - 05:12 PM

Before I forget again about this, here:
http://www.911cd.net...showtopic=24880
I had to do a couple small changes to the batch.
I am attaching also here the (hopefully) "improved" version :).

:cheers:
Wonko

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users