dkreifus Posted January 31, 2006 Share Posted January 31, 2006 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 More sharing options...
tguy Posted January 31, 2006 Share Posted January 31, 2006 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 More sharing options...
RogueSpear Posted January 31, 2006 Share Posted January 31, 2006 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, strCDSet ws = WScript.CreateObject("WScript.Shell")Set fs = CreateObject("Scripting.FileSystemObject")windir = ws.ExpandEnvironmentStrings ("%SYSTEMROOT%")Set colDrives = fs.DrivesFor Each objDrive in colDrives If fs.FileExists(objDrive.DriveLetter & ":\WIN51") Then strCD = objDrive.DriveLetter & ":"NextSub 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 SubCopySourceCopySource.7z Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 1, 2006 Share Posted February 1, 2006 (edited) 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 OFFfor %%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%\I386reg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%SystemDrive%\I386" /freg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v SourcePath /d %SystemDrive% /freg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v ServicePackSourcePath /d %SystemDrive% /freg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v SourcePath /d %SystemDrive%\I386 /fexitI 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 February 1, 2006 by maxXPsoft Link to comment Share on other sites More sharing options...
Yzöwl Posted February 1, 2006 Share Posted February 1, 2006 A similar batch idea without the '3rd Party' robocopy@ECHO OFF&SETLOCAL ENABLEEXTENSIONSMODE 34,5&COLOR E5&TITLE Script By Yz”wlSET SRC=%SYSTEMDRIVE%\I386FOR /F %%? IN ('MOUNTVOL^|FIND ":\"^|FIND /I /V "A:\"') DO IF EXIST %%?I386 CALL :DOCOPY %%?IF EXIST %SRC% CALL :DOREGS HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\SetupPING -n 11 127.0.0.1 >NULENDLOCAL&GOTO :EOF:DOCOPYIF EXIST %SRC% (GOTO :EOF) ELSE (MD %SRC%)TITLE Copying %1I386 to %SRC%ECHO/ COPY IN PROGRESS...&ECHO/&ECHO/ Please wait, it may take a whileECHO>EXCLUDE_.TXT SVCPACKXCOPY %1I386 %SRC% /E/C/I/Q/H/K/EXCLUDE:EXCLUDE_.TXTDEL EXCLUDE_.TXTGOTO :EOF:DOREGSTITLE Adding Registry InfoREG ADD %1 /V "Installation Sources" /T REG_MULTI_SZ /D "%SRC%\0" /FREG ADD %1 /V SourcePath /D "%SRC%" /FREG ADD %1 /V ServicePackSourcePath /D "%SRC%" /FGOTO :EOF Link to comment Share on other sites More sharing options...
RogueSpear Posted February 1, 2006 Share Posted February 1, 2006 And there you have it. Three valid ways to do the same thing I'm sure there's more too and that you'll find something that suits your tastes. Link to comment Share on other sites More sharing options...
Sonic Posted February 1, 2006 Share Posted February 1, 2006 Okay let's go, this is mine (cmd) :@echo offtitle 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=%%pxcopy /s /y "%source%" "%systemdrive%\i386\"set source=%systemdrive%\reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" /d "%source%i386" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "SourcePath" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "ServicePackSourcePath" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Transaction Server\Setup(OCM)" /v "Source Path" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\MSDTC\Setup" /v "Source Path" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\COM3\Setup" /v "Source Path" /d "%source%\" /f >NULexitIt can be run from cmdlines.txt for example. Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 2, 2006 Share Posted February 2, 2006 (edited) without the '3rd Party' robocopyYou ever take a look at that thing? RobocopyIt does more than the dishes and carry out the trashYes theres simpler way's without a third thing but my goodness man this thing is unique as well as fastAnd its built for the command line......Challenge to Yzöwl and RogueSpearWrite/Show me a script will recopy XPCD folder,deleting only what don't belong in original,and add back only whats been deleted or changedperfectlyin short timeIts 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. EDIT: Tests are in on my Machine:Robocopy: 3:56Yzöwl: 4:36RogueSpear: 3:32 as I figured FSO is usually a little fasterThe restore thing I was talking about happens in a little over a minute usually here. Edited February 2, 2006 by maxXPsoft Link to comment Share on other sites More sharing options...
RogueSpear Posted February 2, 2006 Share Posted February 2, 2006 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 More sharing options...
maxXPsoft Posted February 2, 2006 Share Posted February 2, 2006 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 More sharing options...
Yzöwl Posted February 2, 2006 Share Posted February 2, 2006 (edited) 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 February 2, 2006 by Yzöwl Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 2, 2006 Share Posted February 2, 2006 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 failedI'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 More sharing options...
dkreifus Posted February 8, 2006 Author Share Posted February 8, 2006 (edited) Thanks guys!I changed my original post. I decided to go with the robocopy version. The code was simple, easy, and does the job. I'll test it tonight Edited February 8, 2006 by dkreifus Link to comment Share on other sites More sharing options...
maxXPsoft Posted February 8, 2006 Share Posted February 8, 2006 (edited) 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 February 8, 2006 by maxXPsoft Link to comment Share on other sites More sharing options...
ktyeo Posted December 24, 2007 Share Posted December 24, 2007 (edited) Okay let's go, this is mine (cmd) :@echo offtitle 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=%%pxcopy /s /y "%source%" "%systemdrive%\i386\"set source=%systemdrive%\reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion" /v "SourcePath" /d "%source%i386" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "Installation Sources" /t REG_MULTI_SZ /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "SourcePath" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup" /v "ServicePackSourcePath" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\Transaction Server\Setup(OCM)" /v "Source Path" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\MSDTC\Setup" /v "Source Path" /d "%source%\" /f >NULreg add "HKLM\SOFTWARE\Microsoft\COM3\Setup" /v "Source Path" /d "%source%\" /f >NULexitIt 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\"toxcopy /s /y "%source%" "%windir%\options\cabs\"will copy win2k pro cdrom content i386 to c:\winnt\options\cabs folder?tqvm Edited December 25, 2007 by ktyeo Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now