Jump to content

Move/Copy I386 directory from $WIN_NT$.~LS before deletion


Recommended Posts

I'm curious if there's a way to move/copy the I386 directory from the $WIN_NT$.~LS directory to the root of c\ during an install before windows setup deletes this dir. The reason is thus, I'd like to keep those files in the root of c:\ so when the user installs something, it doesn't prompt them for the CD.

---- Workaround 1 - Copy I386 to $OEM$\$1\C\ of Distributed share -----

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

I don't like this for various reasons: 1) tranfers I386 dir twice (2x) during install process - once for $WIN_NT$.~LS directory and once for the $OEM$\$1\C\ directory. 2) for some reason when using this workaround it leave the $WIN_NT$.~LS directory, therefore implementing a cmdlines.txt "script".

Now, I don't know if I've overlooked an option or two in the answerfile (winnt.sif/unattend.txt) to compensate for this. Hopefully I haven't overlooked anything, but feel free to ask questions.

Edit/Delete Message

--- Background ----

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

I'm pxe booting into the xp installer and it uses the unattend.txt so it's fully automated.

Link to comment
Share on other sites


This is for RIS, but could be easily modified for CD or network-based installs. Since the directory exists, run it from something like cmdlines.txt or from SetupParams via a "UserExecute=" from Winnt.sif.

' // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' // Set variables for script
' //

Set objShell = CreateObject("WSCript.shell")
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Setup"
objReg.CreateKey HKEY_LOCAL_MACHINE,strKeyPath

Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colChassis = objWMIService.ExecQuery _
("Select * from Win32_SystemEnclosure")


' // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
' // Determine machine hardware and copy i386 for laptops
' //

For Each objChassis in colChassis
For Each strChassisType in objChassis.ChassisTypes
Select Case strChassisType

Case 1
strEntryName = "MACHINETYPE"
strValue = "Other"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 2
strEntryName = "MACHINETYPE"
strValue = "Unknown"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 3
strEntryName = "MACHINETYPE"
strValue = "Desktop"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 4
strEntryName = "MACHINETYPE"
strValue = "Low_Profile_Desktop"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 5
strEntryName = "MACHINETYPE"
strValue = "Pizza_Box"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 6
strEntryName = "MACHINETYPE"
strValue = "Mini_Tower"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 7
strEntryName = "MACHINETYPE"
strValue = "Tower"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 8
strEntryName = "MACHINETYPE"
strValue = "Portable"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 9
strEntryName = "MACHINETYPE"
strValue = "Laptop"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 10
strEntryName = "MACHINETYPE"
strValue = "Notebook"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 11
strEntryName = "MACHINETYPE"
strValue = "Handheld"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 12
strEntryName = "MACHINETYPE"
strValue = "Docking_Station"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 13
strEntryName = "MACHINETYPE"
strValue = "All-in-One"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 14
strEntryName = "MACHINETYPE"
strValue = "Sub-Notebook"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"

Case 15
strEntryName = "MACHINETYPE"
strValue = "Space_Saving"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 16
strEntryName = "MACHINETYPE"
strValue = "Lunch_Box"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 17
strEntryName = "MACHINETYPE"
strValue = "Main_System_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 18
strEntryName = "MACHINETYPE"
strValue = "Expansion_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 19
strEntryName = "MACHINETYPE"
strValue = "Sub-Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 20
strEntryName = "MACHINETYPE"
strValue = "Bus_Expansion_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 21
strEntryName = "MACHINETYPE"
strValue = "Peripheral_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 22
strEntryName = "MACHINETYPE"
strValue = "Storage_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 23
strEntryName = "MACHINETYPE"
strValue = "Rack_Mount_Chassis"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case 24
strEntryName = "MACHINETYPE"
strValue = "Sealed-Case_PC"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue

Case Else
strEntryName = "MACHINETYPE"
strValue = "Unknown"
objReg.SetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strEntryName,strValue
objShell.Run "robocopy \\RISserver\REMINST\full_source_xpsp2 %systemdrive%\i386 /E"
End Select
Next
Next

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