Jump to content

Recommended Posts

Posted

how do I copy the i386 to the drive and change windows properties so when a program needs files the windows will check them in the i386 directory on the drive?


Posted

The path to the source files is located in the following registrykey:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SourcePath

So just copy the files to the drive perhaps in a subfolder i386 of the windows directory and run the following command:

reg add "HKLM\Software\Microsoft\Windows NT\CurrentVersion" /v "Sourcepath" /t REG_EXPAND_SZ /d "%WINDIR%\i386" /F

Posted (edited)

Here is a VBscript I wrote to do just what you're looking for. Note that I delete the svcpack directory after copying i386 over to the hard drive. I have a few hundred MB worth of silent switchless installers that don't really need to be taking up room in there.

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

'** Subroutine; Copy the i386 folder from the source media and make
'**             the appropriate registry entries.
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


'** Run Tasks
CopySource

Edited by RogueSpear

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