Jump to content

Copy I386 Folder after install?


Recommended Posts

Hi, this topic is rather old but I have a related question.. I'm trying to figure out if it is possible to create a C:\i386 sourcefolder out of the C:\$WIN_NT$.~LS folder...

We are deploying our images through Radia. Basically I want to create a C:\i386 without the need of a networkshare or a CD... Is this possible at all?

Anyone? Thanks a lot!

Edited by gn!uz
Link to comment
Share on other sites

  • 2 months later...

I'm trying with this also...

Doesn't this work?

@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:

XCOPY %CDROM%\I386 %windir%\Driver Cache\I386 /H/S/E/C/F/R/K

What is the switch for overwrite without asking?

From the beginning there is like two files in the i386 folder and proberly it will ask to overwrite them.

Is it best to run a DEL of those two files first or make a overwrite switch somehow?

Edited by zeezam
Link to comment
Share on other sites

@ zeezam - To whom are you replying?

Your response doesn't appear to follow on from any other here!

I'm trying to make a simple script that copies all content in i386 from CD to C:\WINDOWS\Driver Cache\i386 folder.

Link to comment
Share on other sites

@ zeezam - For next time, then use '/?' to list available switches for a cmd command. The one you're looking for is '/y'(overwrite without prompting). Also, you need double-quotes when theres spaces in command-lines.

Tip: You can set all wanted xcopy switches after eachother(like e.g. '/eh' instead of '/e /h'). Also, non-existing destination folders are always auto-generated by xcopy when using a backslash after the folder name.

If run from CD(WinXP version) :

@echo off
setlocal enableextensions
set src=%~d0\I386
set dest=%systemdrive%\I386\
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
xcopy %src% %dest% /e
reg add %key% /v "Installation Sources" /t reg_multi_sz /d "%dest%\0" /f
reg add %key% /v SourcePath /d "%dest%" /f
reg add %key% /v ServicePackSourcePath /d "%dest%" /f
endlocal

If not run from CD(WinXP version) :

@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 src=%%i:\I386
set dest=%systemdrive%\I386\
set key=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup
xcopy %src% %dest% /e
reg add %key% /v "Installation Sources" /t reg_multi_sz /d "%dest%\0" /f
reg add %key% /v SourcePath /d "%dest%" /f
reg add %key% /v ServicePackSourcePath /d "%dest%" /f

I don't really understand how there can be files left in '%systemdrive%\I386\' upon a fresh install, but if you somehow have that, then add the '/y' switch to the 'xcopy' command-line.

Edit: Sorry, after re-reading your post, then i can now see that you wan't to use the destination path: '%windir%\Driver Cache\i386\', so you'll then need to change the script alittle, then...

Edited by Martin H
Link to comment
Share on other sites

  • 1 month later...
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

Sorry, I'm quite new at this. Where should i put this script on the CD?

Link to comment
Share on other sites

  • 1 month later...
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

I relise this is an old post but maybe Rouge Spear you could tell me something. I am using your CopySource.vbs script and it seems to work well apart from two things. If I run a windiff to compare the i386 folder on the CDROM compared to the %systemroot%\i386 I am getting the following differences.. It is not copying these files across.

.\svcpack\branches.inf ..........only in D:\I386

.\svcpack\hfint.dat ..........only in D:\I386

.\svcpack\idnmitigationapis.ca_ ..........only in D:\I386

.\svcpack\ie7.ca_ ..........only in D:\I386

.\svcpack\kb915865.ca_ ..........only in D:\I386

.\svcpack\kb915865.exe ..........only in D:\I386

.\svcpack\kb923789.exe ..........only in D:\I386

.\svcpack\kb941569.ca_ ..........only in D:\I386

.\svcpack\kb941569.exe ..........only in D:\I386

.\svcpack\kb942763.ca_ ..........only in D:\I386

.\svcpack\kb950759-ie7.ca_ ..........only in D:\I386

.\svcpack\kb950759-ie7.exe ..........only in D:\I386

.\svcpack\kb950760.ca_ ..........only in D:\I386

.\svcpack\kb950760.exe ..........only in D:\I386

.\svcpack\kb950762.ca_ ..........only in D:\I386

.\svcpack\kb951376.ca_ ..........only in D:\I386

.\svcpack\kb951698.ca_ ..........only in D:\I386

.\svcpack\mscomppackv1.ca_ ..........only in D:\I386

.\svcpack\mscomppackv1.exe ..........only in D:\I386

.\svcpack\nlsdownlevelmapping.ca_ ..........only in D:\I386

.\svcpack\wmfdist11.ca_ ..........only in D:\I386

.\svcpack\wmfdist11.exe ..........only in D:\I386

.\svcpack\wmp11.ca_ ..........only in D:\I386

.\svcpack\wmp11.exe ..........only in D:\I386

.\svcpack\wudf01000.ca_ ..........only in D:\I386

.\svcpack\wudf01000.exe ..........only in D:\I386

-- 26 files listed

These appear to be the post sp3 hotfixes I have applied and WM11 and IE7. The second problem is that if I run you script manually, to test it I get the following error, I don't know if this has anything to do with the problem. It still continues to do the copy even with this error though.

Windows - Drive Not Ready -

Exception Processing Message c00000a3 parameters 75b6bf7c 75b6bf7c 75b6bf7c

Any help would be apreiciated. :yes:

Link to comment
Share on other sites

The script deletes '%windir%\I386\svcpack\' if it exists, after the copying has finished...

Delete these two lines :

	If fs.FolderExists(windir & "\i386\svcpack") Then fs.DeleteFolder(windir & "\i386\svcpack"),True

Link to comment
Share on other sites

The script deletes '%windir%\I386\svcpack\' if it exists, after the copying has finished...

Delete these two lines :

	If fs.FolderExists(windir & "\i386\svcpack") Then fs.DeleteFolder(windir & "\i386\svcpack"),True

Okay this may be a silly question, but why would you not want to copy the svcpack? Also always when I have changed the Source paths manually I have used 4 registry keys. I see an extra key that is in Yzowl that isn't in RougeSpears, am I missing something. The ones I normally use are.

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\Installation Sources

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\ServicePackSourcePath

HKLM\Software\Microsoft\Windows\CurrentVersion\Setup\SourcePath

HKLM\Software\Microsoft\WindowsNT\CurrentVersion\SourcePath

Edited by purkleturkle
Link to comment
Share on other sites

Okay this may be a silly question, but why would you not want to copy the svcpack?

On a clean untouched Windows CD/ISO, there isn't any svcpack folder, and that folder is either custom made, or added by integrating updates with the '/integrate' switch and so many times you will not need that folder in the paths...

I see an extra key that is in Yzowl that isn't in RougeSpears, am I missing something.

"Installation Sources" stores all the possible locations for Windows to check for installation files...

The two others, are 'SourcePath' which stores the default location where Windows checks for an installation CD and is by default set as the first CD-drive and 'ServicePackSourcePath' which stores the default location where the last service pack where installed from...

Link to comment
Share on other sites

If you are using WINNT32.EXE to install XP you can use the /COPYDIR:I386 switch. It works fine for me, you end up with the Installation files in C:\WINDOWS\I386. It doesn't seem to take any longer to install either. Then you just load a regfile or write a script to change the sourcepath locations.

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...