Jump to content

Easiest way to copy i386 dir to HD during UAI


Recommended Posts

I've been doing unattended installs for quite some time now, but have never learned how to do basic things like copying the i386 directory to HD and resetting sourcepath to c:\i386. Would someone give me several examples of the portion of the winnt.sif that would accomplish this for me.

TIA

aj

Link to comment
Share on other sites


I use this cmd file that someone posted awhile ago.

you may want to edit it to suit your needs.

I run it in my runonceex.cmd file.

cmdow @ /HID
@ECHO OFF

@ECHO OFF
IF EXIST C:\WIN51IP set CDROM=C:
IF EXIST D:\WIN51IP set CDROM=D:
IF EXIST E:\WIN51IP set CDROM=E:
IF EXIST F:\WIN51IP set CDROM=F:
IF EXIST G:\WIN51IP set CDROM=G:
IF EXIST H:\WIN51IP set CDROM=H:
IF EXIST I:\WIN51IP set CDROM=I:
IF EXIST J:\WIN51IP set CDROM=J:
IF EXIST K:\WIN51IP set CDROM=K:
IF EXIST L:\WIN51IP set CDROM=L:
IF EXIST M:\WIN51IP set CDROM=M:
IF EXIST N:\WIN51IP set CDROM=N:
IF EXIST O:\WIN51IP set CDROM=O:
IF EXIST P:\WIN51IP set CDROM=P:
IF EXIST Q:\WIN51IP set CDROM=Q:
IF EXIST R:\WIN51IP set CDROM=R:
IF EXIST S:\WIN51IP set CDROM=S:
IF EXIST T:\WIN51IP set CDROM=T:
IF EXIST U:\WIN51IP set CDROM=U:
IF EXIST V:\WIN51IP set CDROM=V:
IF EXIST W:\WIN51IP set CDROM=W:
IF EXIST X:\WIN51IP set CDROM=X:
IF EXIST Y:\WIN51IP set CDROM=Y:
IF EXIST Z:\WIN51IP set CDROM=Z:
ECHO Please wait, Recovery Console is being installed locally.
%CDROM%\i386\winnt32.exe /dudisable /cmdcons /unattend
md %systemroot%\Source\i386
ECHO Please wait, source files are being copied.  This may take several minutes.
xcopy /Y /E /H %CDROM%\i386\*.* %systemroot%\Source\i386\
ECHO Adding registry entries.
regedit.exe /s %CDROM%\Install\Source.reg
ECHO Done.
EXIT

And here's the reg file

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
"SourcePath"="%systemroot%\\Source\\"
"ServicePackSourcePath"="%systemroot%\\Source\\"

Link to comment
Share on other sites

You could shrink that first one down by using the following:

cmdow @ /HID
@ECHO OFF

@ECHO OFF
for %%i in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WIN51IP set CDROM=%%i:
ECHO Please wait, Recovery Console is being installed locally.
%CDROM%\i386\winnt32.exe /dudisable /cmdcons /unattend
md %systemroot%\Source\i386
ECHO Please wait, source files are being copied.  This may take several minutes.
xcopy /Y /E /H %CDROM%\i386\*.* %systemroot%\Source\i386\
ECHO Adding registry entries.
regedit.exe /s %CDROM%\Install\Source.reg
ECHO Done.
EXIT

You'll get the exact same results, it's just not a cluttered file.

Link to comment
Share on other sites

  • 2 weeks later...
Okay,

It copied the i386 directory inside the windows directory.  What can I change to have it copy to root of the c drive?

change xcopy /Y /E /H %CDROM%\i386\*.* %systemroot%\Source\i386\

to xcopy /Y /E /H %CDROM%\i386\*.* %systemdrive%\Source\i386\

assuming C: is your systemdrive, otherwise just change %systemdrive%

to C:\ you'll also need to make the neccessary changes to the reg file.

Link to comment
Share on other sites

I think you're looking for

  • %SYSTEMDRIVE%

Here's my version of the above, the differences being the path you've stated, I have removed the cmdow which will defeat the object of all your echoes, I have used robocopy, which should be in the same directory as this batch, I have added the registry entries directly from the batch instead of using the reg file and finally if you need it, installed the recovery console from the hard drive instead of the CD

@echo off&setlocal enableextensions
set hdsrc=%systemdrive%\
set drive=d e f g h i j k l m n o p q r s t u v w x y z
set xptag=\WIN51
for %%a in (%drive%) do if exist "%%a:%xptag%" set CDROM=%%a:
if not exist %hdsrc%I386 md %hdsrc%I386
echo Please wait, source files are being copied.  This may take several minutes.
%~dp0robocopy.exe %CDROM%\I386 %hdsrc%I386 /e /copy:da /r:30 /w:10 /a-:r
echo Adding registry entries.
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v SourcePath /d "%hdsrc%" /f
reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup /v ServicePackSourcePath /d "%hdsrc%" /f
echo Please wait, Recovery Console is being installed locally.
start "" /wait %hdsrc%\winnt32.exe /dudisable /cmdcons /unattend
endlocal&goto :eof

Edited by Yzöwl
Link to comment
Share on other sites

Here is a script that I use.

1\ Check to see if the XPCD is on %systemdrive%

2\ If it not there then it build the work directory

3\ If It is then it checks to see if XP is in the CD drive

4\ If it not there then it gives the option to quit or

it ask to place the XP Cd In the CD Drive

5\ If the work directory is there and it the correct CD

then it start the copy.

The ping cmd is a way to pause the script with out

using Sleep.exe

Echo Off
CLS && Color 1F && Mode 65,5 && Title Ua Build Directory And Copy

for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\SETUP.exe set CDROM=%%i

if exist %systemdrive%\XPCD\ goto 000

if not exist %systemdrive%\XPCD\ goto 001

:000
CLS && Color F1 && Mode 55,5
Echo. && echo The Work directory Was There
ping -n 2 127.0.0.1>nul
goto CopyCd2HD

:001
CLS
COLOR A0
ECHO Make Work Directory
PING -N 3 127.0.0.1>NUL
mkdir %systemdrive%\XPCD\$OEM$\
mkdir %systemdrive%\XPCD\$OEM$\$1\
mkdir %systemdrive%\XPCD\$OEM$\$1\Drivers
mkdir %systemdrive%\XPCD\$OEM$\$1\Drivers\002_graphics
mkdir %systemdrive%\XPCD\$OEM$\$1\Drivers\004_sound
mkdir %systemdrive%\XPCD\$OEM$\$1\Install
mkdir %systemdrive%\XPCD\$OEM$\$$\Fonts
mkdir %systemdrive%\XPCD\$OEM$\$$\Media
mkdir %systemdrive%\XPCD\$OEM$\$$\Resources\Themes
mkdir %systemdrive%\XPCD\$OEM$\$$\System32
mkdir %systemdrive%\XPCD\$OEM$\$$\Web\Wallpaper
mkdir %systemdrive%\XPCD\Apps
mkdir %systemdrive%\XPCD\i386
ECHO      Completed Building The Work Directory!
ping -n 3 127.0.0.1>NUL
goto CopyCd2HD


:CopyCd2HD
If exist %cdrom%\setup.exe goto CopyCd

If Not exist %cdrom%\setup.exe goto User

:User
CLS && Color 4f && Mode 65,8 && Title User make A Selection?
Echo Please Insert The XP Cd To Continue
Echo.
Echo Type Yes To Continue && Echo Type Quit To Exit
echo.
SET Choice=
SET /P Choice=Type Yes Or Quit and press Enter:
IF NOT '%choice%'=='' SET select=%choice:~0,9%
IF /I '%choice%'=='Yes' GOTO CopyCd
IF /I '%choice%'=='Quit' GOTO end2
IF /I '%Choice%'=='%Choice%' GOTO OPS

:OPS
CLS && MODE 55,3 && COLOR 9F
ECHO. && ECHO NOT A VALID SELECTION
ping -n 3 127.0.0.1>nul
GOTO User

:Missing
CLS && MODE 55,3 && Color 9e
Echo.
Echo Please Insert The Cd
ping -n 3 127.0.0.1>nul
goto User

:CopyCd
If Not exist %cdrom%\setup.exe goto Missing
cls
mode 97,5
color 0e
ECHO   Begin The Copy?
ping -n 2 127.0.0.1>nul
xcopy %cdrom%\...\...\ %systemdrive%\XPCD\ /S /E /W /F /I /v
cls && mode 55,3 && color f9 && Title Copy Completed!
ECHO. && ECHO Copy To Hard Drive Completed!
echo.
PING -N 4 127.0.0.1>NUL
goto End1

:End1
CLS && Color f3 && Mode 55,3 && Title Completed Copy
echo. && Echo Goodbye The Script Is Completed!
ping -n 4 127.0.0.1>nul
goto EOF
Exit

:end2
CLS && Color f3 && Mode 55,3 && Title User Selected To Exit
echo. && Echo User Has Selected To Quit This Script && Ping -n 3 127.0.0.1>nul
goto EOF
Exit

Link to comment
Share on other sites

Yowzl...

many thanks.

one question... it always asks for confirmation of overwriting the reg entries regarding the sourcepath. Is there anyway to have it automatically make the entry?

Oops.... one more question.... what does the /f switch do?

i made great progress this weekend.... got my runonceex.cmd to work properly the first time (using the guide) and was able to have reader 7.01, jre 1.5 and netfxsp1 to install (unattended).

thanks again

aj

Link to comment
Share on other sites

Yowzl...

many thanks.

one question... it always asks for confirmation of overwriting the reg entries regarding the sourcepath. Is there anyway to have it automatically make the entry?

Oops.... one more question.... what does the /f switch do?

i made great progress this weekend.... got my runonceex.cmd to work properly the first time (using the guide) and was able to have reader 7.01, jre 1.5 and netfxsp1 to install (unattended).

thanks again

aj

Link to comment
Share on other sites

wow, talk about using a sledge hammer to kill a fly. Keep it simple. This is how I do it.

Call install.cmd from winnt.sif

[GuiRunOnce]
   command9= "%SystemDrive%\install.cmd"

install.cmd located in $OEM$\$1

@ECHO OFF

rem find the CDROM letter ...
for %%i in (D E F G H I J K L M N O P Q R S T U V W X Y Z) do if exist %%i:\WIN51 SET cdrom=%%i:

rem copies i386 to hard drive ...
ECHO Please wait, source files are being copied.  This may take several minutes.
xcopy %CDROM%\i386\*.* %SystemDrive%\Support\i386\ /e /i /h /y

rem adds source location for i386 to registry
ECHO Adding registry entries.
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%SystemDrive%\Support\i386" /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath /d %SystemDrive%\Support /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v ServicePackSourcePath /d %SystemDrive%\Support /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath /d %SystemDrive%\Support\I386 /f

rem runs cleanup script
start %cdrom%\install\cleanup.cmd

exit

install.cmd

Edited by dlevens
Link to comment
Share on other sites

Howdy

I'm An Unattended Newbie Still Tweaking And Reloading Over And Over, And I Just Didn't Want The Added Time Of Copying The Files To The Hard Drive Over And Over, But Still Wanted Access To Them After Install & While Comparing The Answer Files From The UA, Sysprep And RIS Answer Files, I Found This In The RIS

[setupMgr]

DistFolder=C:\windist

DistShare=windist

I Know This Is Not A Remote Install And Not What Ur Asking For, For Myself I Figured It Was Worth The Try, Really I'm Not Sure If This Option Is Good, Bad Or If Windows Knows Its There, But I Get No Errors When Winnt.Sif Loads

Any Way I Copied The Files To A Small Partition For Keeping And Adjusted The Path Accordingly

Maybe This Can Help

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...