Install.bat fixed now will install from batch.
Q: Why would you want to use this process?
A: This would remove the need for another program to be ran prior to installing your OS, example: partitioning a hard drive to your liking(you can use Diskpart from PE), Virus scanning the hard drive(Here I show you how to integrate Mcafee command line) etc.
What you will need:
1. About 2 hours of time
2. Windows OPK CD (or ISO image of an existing WinPE ISO)
3. Windows XP Pro or Server 2003 (Not applicable if you are using an existing ISO)
4. Windows XP pro/home/2000/2003 files out of an ISO, or off a CD.
5. cdimage.exe and a valid XP boot image(easily obtained from MSFN)
6. Some random .exe’s (getcd.exe, screenres.exe) Optional
7. McAfee 32bit command line scanner Optional
Step 1. Preparing your installations
**Warning this method will NOT work with Gosh’s way of reducing the size of source, I would use an alternate method that will allow you to keep winnt32.exe**
There are many ways to do this, you can use a multiboot CD( I HAVE NOT TRIED THIS!) if you like that can be booted into WinPE or you may just boot into WinPE directly off of the CD, I do the latter. You may also use your Unattended files *Remember to use it as unattended.txt instead of winnt.sif in your batchfiles*
On a spare partition or existing free space of your hard drive Copy your desired installations to there respective folders, here I used XP_PRO, *note if you want to keep your existing structure go ahead and substitute your folder names*
Step 2. Preparing Windows PE
Follow the instructions provided in you OPK documentation for making a custom CD, I used a SP2 Beta edition due to the updated drivers, you can XP SP1/SP2 or 2003. Also if you already have an ISO, you can skip making the ISO.
Extract the contents of the ISO to a folder called WinPE. Should be about 142MB. You may use the information provided with the OPK to reduce the size or use Gosh’s batch file, it removes them for you.
Step 3. Combining folders
Take your XP_PRO, or what ever other OS’s you want, and put it in the root of the WinPE folder, This can be done with other OS’s too like Home etc.
(Example:
WinPE
|_____I386
|_____XP_PRO
|_____rest of files(Winbom.ini, win51,etc) )
This is all you need to do to be able to install from within WinPE but I am going to keep going and show you all how to make is useful to use….
Step 4.
Obtain the file neededexe’s from this post included here are getcd.exe which does what it says gets your CDROM drive letter, very helpful for multiple machines. The other is setres.exe, I was tired of working in 800x600 mode so I integrated this little utility in with a batch file that runs when Startnet.cmd runs. I will supply my batch files for ease of use.
The following files (getcd.exe, setres.exe, and all batch files) get put in the WinPE\i386\system32 folder, also edit your startnet.cmd in same folder to launch the setres.bat.
Example batch files below:
STARTNET.CMD
regsvr32 /s netcfgx.dll factory -minint netcfg -v -winpe net start dhcp net start nla SetRes.bat
SetRes.bat
CLS
@ECHO off
TITLE "WinPE Recovery & XP Pro install disk..."
@ECHO off
ECHO.
ECHO Select your screen resolution below...
ECHO *If your resolution is not supported
ECHO WinPE will revert it to 640x480*
FOR /F "tokens=*" %%a in ('getcd.exe') do set CDROM=%%a
@ECHO off
:start
ECHO.
ECHO 1. 640x480
ECHO 2. 800x600
ECHO 3. 1024x768
ECHO 4. 1280x1024
ECHO 5. 1600x1200
ECHO 6. Use default
set choice=
set /p choice=Type the number you would like to do?:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto 640
if '%choice%'=='2' goto 800
if '%choice%'=='3' goto 1024
if '%choice%'=='4' goto 1280
if '%choice%'=='5' goto 1600
if '%choice%'=='6' goto default
ECHO "%choice%" invalid! Try again...
ECHO.
goto start
:640
ECHO Setting resolution to 640x480...
@echo off
%CDROM%\i386\system32\setres.exe h640 v480 b32
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:800
ECHO Setting resolution to 800x600...
@echo off
%CDROM%\i386\system32\setres.exe h800 v600 b32
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:1024
ECHO Setting resolution to 1024x768...
@echo off
%CDROM%\i386\system32\setres.exe h1024 v768 b32
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:1280
ECHO Setting resolution to 1280x1024...
@echo off
%CDROM%\i386\system32\setres.exe h1280 v1024 b32
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:1600
ECHO Setting resolution to 1600x1200...
@echo off
%CDROM%\i386\system32\setres.exe h1600 v1200 b32
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:default
ECHO Using default options...
CLS
ECHO.
ECHO To install Windows XP type "Install" without quotes...
goto end
:end
Install.bat
CLS
@ECHO off
TITLE "WinPE Recovery & XP Pro install disk..."
@ECHO off
ECHO.
ECHO Select options below...
FOR /F "tokens=*" %%a in ('getcd.exe') do set CDROM=%%a
@ECHO off
:start
ECHO.
ECHO 1. Install XP PRO (Unattended)
ECHO 2. Return to command shell
set choice=
set /p choice=Type the number you would like to do?:
if not '%choice%'=='' set choice=%choice:~0,1%
if '%choice%'=='1' goto Install
if '%choice%'=='2' goto No
ECHO "%choice%" invalid! Try again...
ECHO.
goto start
:Install
ECHO Starting Installation...
@echo off
set AnswerFile="%CDROM%\XP_PRO\I386\unattend.txt"
set SetupFiles="%CDROM%\XP_PRO\I386"
%CDROM%\XP_PRO\I386\winnt32.exe /s:%SetupFiles% /unattend:%AnswerFile%
goto end
:No
ECHO Going back to Shell...
CLS
goto end
:end
Now feel free to edit these batch files for your use.
Step 5. Antivirus
Go to http://vil.nai.com/vil/virus-4d.asp, download dailyscan.zip, create another folder in your WinPE dir named Antivirus or scan, what ever you like, and extract the files from dailyscan.zip to your new folder, now you have 32bit command line scanning abilities in WinPE.
Step 6. Building your ISO
Now open a command prompt and navigate to where you put CDIMAGE.exe and your XP boot image, input something like this:
CDIMAGE.EXE -lPEXP_EN2 -t02/04/2004,13:00:00 -h -j1 -m -O -bxpboot.img E:\x86winpe E:\WinPEXP.ISO
Remember to edit it with your directory locations!!!
Now boot up VPC or VMware and see if it worked.
Good luck!!
--Likuidkewl
Please post any issues you are having, as this will help further develope this topic.
Attached File(s)
-
neededEXEs.rar (45.74K)
Number of downloads: 697
This post has been edited by likuidkewl: 19 February 2004 - 09:47 PM



Help


Back to top









