Jump to content

Copy I386 Folder after install?


Recommended Posts

For our corporate image, we want to have the I386 folder located on the %systemdrive%.

At would point would you recommend copying the I386 folder to the c: drive? Does it make a difference?

I just don't want to copy it into the $OEM$ folder. I'm trying to reduce redundancy

Link to comment
Share on other sites


I would still suggest putting it in the $OEM$ folder then use cdimage.exe to create the .iso image. It has command line switches available that will create pointers to the first instance of a particular file for all subsequent copies of that file that it finds and will greatly reduce the amount of space used.

Otherwise you can copy the files over with a batch file in the cmdlines.txt or GuiRunOnce or RunOnceEx it is up to you.

Link to comment
Share on other sites

Here's a small script that I wrote that does just what you're looking for. The only difference is that it copies i386 to the %SystemRoot% directory instead of %SystemDrive%. Also, it makes the appropriate registry entries so that the workstation will look to that directory for the i386 source.

Dim ws, fs, windir, colDrives, objDrive, strCD
Set ws = WScript.CreateObject("WScript.Shell")
Set fs = CreateObject("Scripting.FileSystemObject")
windir = ws.ExpandEnvironmentStrings ("%SYSTEMROOT%")
Set colDrives = fs.Drives
For Each objDrive in colDrives
If fs.FileExists(objDrive.DriveLetter & ":\WIN51") Then strCD = objDrive.DriveLetter & ":"
Next

Sub CopySource
Dim strKeyPath
strKeyPath = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\"
fs.CopyFolder (strCD & "\i386"), (windir & "\i386"),True
If fs.FolderExists(windir & "\i386\svcpack") Then fs.DeleteFolder(windir & "\i386\svcpack"),True
ws.RegWrite strKeyPath & "SourcePath", "%systemroot%\\i386\\", "REG_SZ"
ws.RegWrite strKeyPath & "ServicePackSourcePath", "%systemroot%\\i386\\", "REG_SZ"
End Sub

CopySource

CopySource.7z

Link to comment
Share on other sites

This is my simple copiesi386.cmd file, for this I use robocopy.exe which is really fast compared to other routines. Just do a Google and you should find. I then copy it over to System32 during Install.

@ECHO OFF

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:

robocopy %CDROM%\I386 /MIR /V %SystemDrive%\I386

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%SystemDrive%\I386" /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath /d %SystemDrive% /f

reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v ServicePackSourcePath /d %SystemDrive% /f

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath /d %SystemDrive%\I386 /f

exit

I add to my Runoncex.cmd to execute it
"Cmd /c start /min /wait %systemdrive%\Install\copiesi386.cmd"

Create the copiesi386.cmd in your Install Folder

Edited by maxXPsoft
Link to comment
Share on other sites

A similar batch idea without the '3rd Party' robocopy

@ECHO OFF&SETLOCAL ENABLEEXTENSIONS
MODE 34,5&COLOR E5&TITLE Script By Yz”wl
SET SRC=%SYSTEMDRIVE%\I386
FOR /F %%? IN ('MOUNTVOL^|FIND ":\"^|FIND /I /V "A:\"') DO IF EXIST %%?I386 CALL :DOCOPY %%?
IF EXIST %SRC% CALL :DOREGS HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
PING -n 11 127.0.0.1 >NUL
ENDLOCAL&GOTO :EOF
:DOCOPY
IF EXIST %SRC% (GOTO :EOF) ELSE (MD %SRC%)
TITLE Copying %1I386 to %SRC%
ECHO/ COPY IN PROGRESS...&ECHO/&ECHO/ Please wait, it may take a while
ECHO>EXCLUDE_.TXT SVCPACK
XCOPY %1I386 %SRC% /E/C/I/Q/H/K/EXCLUDE:EXCLUDE_.TXT
DEL EXCLUDE_.TXT
GOTO :EOF
:DOREGS
TITLE Adding Registry Info
REG ADD %1 /V "Installation Sources" /T REG_MULTI_SZ /D "%SRC%\0" /F
REG ADD %1 /V SourcePath /D "%SRC%" /F
REG ADD %1 /V ServicePackSourcePath /D "%SRC%" /F
GOTO :EOF

Link to comment
Share on other sites

Okay let's go, this is mine (cmd) :

@echo off
title Copy CD to hard disk ...
for /f "skip=4 tokens=3" %%p in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set source=%%p
xcopy /s /y "%source%" "%systemdrive%\i386\"
set source=%systemdrive%\
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" /d "%source%i386" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "SourcePath" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "ServicePackSourcePath" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Transaction Server\Setup(OCM)" /v "Source Path" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\MSDTC\Setup" /v "Source Path" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\COM3\Setup" /v "Source Path" /d "%source%\" /f >NUL
exit

It can be run from cmdlines.txt for example.

Link to comment
Share on other sites

without the '3rd Party' robocopy

You ever take a look at that thing? Robocopy

It does more than the dishes and carry out the trash

Yes theres simpler way's without a third thing but my goodness man this thing is unique as well as fast

And its built for the command line......

Challenge to Yzöwl and RogueSpear

Write/Show me a script will recopy XPCD folder,

deleting only what don't belong in original,

and add back only whats been deleted or changed

perfectly

in short time

Its a 100% backup/restore machine, best thing I've seen in awhile come out of MS and its old. So many options its unreal.

yes its nearly impossible with scripting, or do you wanna try????????????

Guess what I'm saying is theres time for the Dos/FSO and theres time for not.

This guy can use whatever he likes, we just provide the options. :thumbup

EDIT: Tests are in on my Machine:

Robocopy: 3:56

Yzöwl: 4:36

RogueSpear: 3:32

as I figured FSO is usually a little faster

The restore thing I was talking about happens in a little over a minute usually here.

Edited by maxXPsoft
Link to comment
Share on other sites

I don't have anything against Robocopy, I just like to invoke as few command line utilities as possible and always try to keep things "native" so to speak. For starters I don't have to worry about if someone has robocopy or not and further if I don't have to open up a cmd thread then all the better.

In my book, speed is nice, but not necessarily the end all be all. It is kinda nice that mine clocked in fastest though ;)

Link to comment
Share on other sites

FSO is faster and I use it a lot myself, but theres things it cannot do simply speaking. 1 is that restore thing i talk about.

We'll have to see what Msh will do cause it's totally different and offer's much more power...

Link to comment
Share on other sites

Agreed...to do those tasks, on an installed system, it is a superb tool.

I use robocopy often, I just felt that as an alternative to your script, it would be nice to also have an option where a non-standard tool didn't need adding to your installation source. Since the built in tool was capable of copying the I386 directory tree excluding the SVCPACK directory and contents, then I felt it worthy of inclusion.

I also added mine to show things like if the I386 already exists at %SystemDrive% add the reg entries but do not copy. If for some reason something prevents the I386 from being created on %SystemDrive% no reg entries are added.

I actually liked the fact in this case that the vbs was not five times longer than the batch!

<Edit>

maxXPsoft, have you ever tried XXCOPY, click this link for a comparison.

</Edit>

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

I add this robocopy to my distro cause its something simple and fast and can do those things I need done. I even use it as a backup tool to write from from 1HD to another and it has never failed

I've allway's known FSO is faster than the batch, delete an entire XPCD in mere seconds, way faster than any API I use or any batch I use.

Anything we've offered here should do dkreifus okay though

Link to comment
Share on other sites

You said you changed your original post so I guess you're asking when to run the I386 copy.

I do mine at beginning of Runoncex.cmd. It can be later like in Cleanup.cmd as long as you are not ejecting CD.

Edited by maxXPsoft
Link to comment
Share on other sites

  • 1 year later...
Okay let's go, this is mine (cmd) :

@echo off
title Copy CD to hard disk ...
for /f "skip=4 tokens=3" %%p in ('reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath') do set source=%%p
xcopy /s /y "%source%" "%systemdrive%\i386\"
set source=%systemdrive%\
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" /d "%source%i386" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "SourcePath" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "ServicePackSourcePath" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\Transaction Server\Setup(OCM)" /v "Source Path" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\MSDTC\Setup" /v "Source Path" /d "%source%\" /f >NUL
reg add "HKLM\SOFTWARE\Microsoft\COM3\Setup" /v "Source Path" /d "%source%\" /f >NUL
exit

It can be run from cmdlines.txt for example.

=================================

Can the above cmd used for windows 2000 pro unattended install by nlite?

It it true %source% is not recognised in nlite for windows 2000 pro because my line below in cmdlines.txt just does not work..?

"%systemroot%\system32\xcopy.exe %source%\i386\*.* %windir%\options\cabs\ /c /f /h /i /r /y"

what is the equivalent of %source% for windows 2000 pro?

if the above does work.. if i modify:

xcopy /s /y "%source%" "%systemdrive%\i386\"

to

xcopy /s /y "%source%" "%windir%\options\cabs\"

will copy win2k pro cdrom content i386 to c:\winnt\options\cabs folder?

tqvm

Edited by ktyeo
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...