jeremyotten Posted May 21, 2007 Posted May 21, 2007 This is the caseIm making a universal image and im very far. sysprep -bmsd is ok ofcourse but it will not add entries to mass storage drivers of www.driverpacks.net. I need to do this by hand. Is someone capable to create a script that reads al the PCI etc entries from .inf files from the massstorage driverpacks and add them in a simulair way to the sysprep.inf [buildMassStorage] section as the sysprep -bmsd does?this way I can automate it and I will share my ONE4ALL creator method here for you all!same of [buildMassStorage] section in sysprep.infpci\ven_10aa&dev_0000=c:\windows\inf\machine.infpci\ven_1025&dev_1435=c:\windows\inf\machine.infpci\ven_10b9&dev_1445=c:\windows\inf\machine.infpci\ven_10b9&dev_1489=c:\windows\inf\machine.infpci\ven_10b9&dev_1449=c:\windows\inf\machine.infPlease assist. I know that icemanND is very good with scripting.... ;-)
IcemanND Posted May 21, 2007 Posted May 21, 2007 Are you just trying to add all of the PCI entries to the sysprep.inf or are you wanting to install the drivers to the OS also?That script I helped you with oh so long ago will do the first. There are a few drivers in the pack which are not signed so you have to either click OK to a few hundred messages or I create an autoit script that watch for the message and clicked ok for me.
jeremyotten Posted May 21, 2007 Author Posted May 21, 2007 No this is another request.The script that you made was great. But I found someone who made that part far more easier.http://www.vernalex.com/tools/spdrvscn/index.shtmlso I need you help with this one.....
jeremyotten Posted May 21, 2007 Author Posted May 21, 2007 Hmm you are right you hwid.cmd script does this this is the code:rem %1 is path to MassDriverPacks FolderIF "%1"=="" GOTO EOFIF NOT EXIST %1 GOTO EOFSETLOCAL ENABLEDELAYEDEXPANSIONSET STDOUT=%cd%\HWIDS.TXTTYPE>%STDOUT% 2>NUL::traverse drivers pathCALL :TRAVERSAL %1GOTO EOF:TRAVERSALPUSHD %1for /f %%f in ('Dir /b *.inf') do ( for /f "eol=- tokens=2 delims=," %%i in ('find /i "pci\ven" %%f') do ( for /f "tokens=*" %%j in ("%%i") do ( for /f "tokens=1* delims=_" %%k in ("%%j") do ( if /i "%%k" EQU "PCI\VEN" ( for /f "usebackq tokens=1* delims=; " %%a in ('%%j') do ( echo %%a=%cd%\%%f>>%STDOUT% ) ) ) )))FOR /F %%I IN ('DIR /AD /OGN /B') DO (CALL :TRAVERSAL %CD%\%%I)POPDGOTO EOF:EOFCan you update this script to auto add the contents of hwid.txt directly under de [buildMassStorage] section of sysprep.infand what about the driver signing problem. Has anybody already solved this?
IcemanND Posted May 21, 2007 Posted May 21, 2007 That just sets the devicepath in the sysprep file or registry. I'm talking about this one (slightly modified for my own use):sysprep_run.cmd@echo offdel /a /f /q sysprep.infdel /a /f /q sysprep.middel /a /f /q hwids.txtCall :Cleanupsetlocal enabledelayedexpansionEcho Creating MassStorageSection of Sysprep.infrem change path of next statement to the path containing the masstorage drivers, this then creates hwids.txtrem which contains the list of pci devices from the inf files.Call :HWID c:\DP\Mrem this appends the hwids.txt to the end of a temporary sysprep file which contains all of the settings I want Rem and ends with the [SysprepMassStorage] section headercopy sysprep.hold /a +hwids.txt /a sysprep.infrem in case anything had been added to the devicepath key in the past I reset it to the default.reg add HKLM\Software\Mirosoft\Windows\CurreVersion /v DevicePath /t REG_EXPAND_SZ /d %windir%\inf; /fRem last chance to quit before sysprep runsEcho Preparing to Run SysprepEcho.Echo Last Chance to stopEcho Press CTRL-C to exit orPauserem add in the additional device paths's (replace with vernalex's tool if desired)Echo Creating DevicePath in registry to additional driversSetDevicePath c:\DPrem continue watches for the driversigning message boxes and clicks ok.Start Continue.exerem dodn't remember why I added this, may not really be needed.Start WatchDriverSigningPolicy.exeRem the server service must be started in order for sysprep 2.0 to run, my images all have it disable when rem the systems are deployed. so here I enable and start the server service and then disable it, but it isrem left running.Echo Starting and disabling Server Service for Sysprepsc config lanmanserver start= demandsc start lanmanserversc config lanmanserver start= disabledsysprep -reseal -mini -pnp -norebootpauseGOTO EOF:HWIDrem %1 is path to MassDriverPacks FolderIF "%1"=="" GOTO EOFIF NOT EXIST %1 GOTO EOFSETLOCAL ENABLEDELAYEDEXPANSIONSET STDOUT=%cd%\HWIDS.TXTTYPE>%STDOUT% 2>NUL::traverse drivers pathCALL :TRAVERSAL %1GOTO EOF:TRAVERSALPUSHD %1for /f %%f in ('Dir /b *.inf') do ( for /f "eol=- tokens=2 delims=," %%i in ('find /i "pci\ven" %%f') do ( for /f "tokens=*" %%j in ("%%i") do ( for /f "tokens=1* delims=_" %%k in ("%%j") do ( if /i "%%k" EQU "PCI\VEN" ( for /f "usebackq tokens=1* delims=; " %%a in ('%%j') do ( echo %%a=%cd%\%%f>>%STDOUT% ) ) ) )))FOR /F %%I IN ('DIR /AD /OGN /B') DO (CALL :TRAVERSAL %CD%\%%I)POPDGOTO EOF:DriversPathPUSHD %1IF EXIST *.INF SET OemPnPDriversPath=!OemPnPDriversPath!;%CD:~3%FOR /F %%I IN ('DIR /AD /OGN /B') DO ( CALL :DriversPath %CD%\%%I)POPDGOTO EOF:Cleanuppushd c:\for %%D in (C 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 %%D:\recycler ( CD /D %%D:\recycler for %%F in ('Dir /ad /b') do rd /s /q "%%F" >> c:\cleanup.log ))cd /d c:\del /a /s /f /q *.pnf >> c:\cleanup.logdel /a /s /f /q *.tmp >> c:\cleanup.logdel /a /s /f /q infcache.* >> c:\cleanup.logdel /a /s /f /q "%windir%\temp" >> c:\cleanup.logfor /f "tokens=*" %%i in ('dir /s /a /b temp') do del /a /s /f /q "%%i" >> c:\cleanup.logfor /f "tokens=*" %%i in ('dir /s /a /b tempor*') do del /a /s /f /q "%%i" >> c:\cleanup.logdel /a /s /f /q "%temp%" >> c:\cleanup.logdel /a /s /f /q "%tmp%" >> c:\cleanup.logpopdgoto eof:EOFcontinue.exe autoit script code:; <AUT2EXE VERSION: 3.1.1.0>; ----------------------------------------------------------------------------; <AUT2EXE INCLUDE-START: continue.au3>; ----------------------------------------------------------------------------; ----------------------------------------------------------------------------;; AutoIt Version: 3.1.0; Author: IcemanND;; Script Function:; Click Continue Anyway for hardware installation during sysprep;; ----------------------------------------------------------------------------; Script Start - Add your code below heredowhile not (winexists ("Hardware Installation") or winexists ("Confirm File Replace") or winexists ("Installation Complete"))wendSleep (100)if winexists("Hardware Installation") then send("+{TAB}{ENTER}")if winexists("Confirm File Replace") then send("{TAB}{ENTER}")if winexists("Installation Complete") then send("{ENTER}")until 1=2; ----------------------------------------------------------------------------; <AUT2EXE INCLUDE-END: continue.au3>; ----------------------------------------------------------------------------Sysprep.hold;SetupMgrTag[Unattended] OemSkipEula=Yes TargetPath=\WINDOWS InstallFilesPath=C:\sysprep\i386 KeepPageFile=0 UpdateInstalledDrivers=Yes DriverSigningPolicy=Ignore UpdateUPHAL="APCIAPIC_MP,%windir%\inf\hal.inf"[GuiUnattended] AdminPassword="password" EncryptedAdminPassword=NO AutoLogon=Yes AutoLogonCount=5 OEMSkipRegional=1 OEMDuplicatorstring="Universal Intel Image 03/17/06" TimeZone=35 OemSkipWelcome=1[UserData] ProductID=go get one somewhere else FullName="company User" OrgName="my company" ComputerName=*[SetupMgr] DistFolder=C:\sysprep\i386 DistShare=windist[Display] BitsPerPel=32 XResolution=1024 YResolution=768[TapiLocation]CountryCode=1Dialing=ToneAreaCode=510[Branding] BrandIEUsingUnattended=Yes[Proxy] Proxy_Enable=0 Use_Same_Proxy=0[Identification] JoinWorkgroup=WORKGROUP[Networking] InstallDefaultComponents=Yes[Sysprep] BuildMassStorageSection=yes[SysprepMassStorage]
IcemanND Posted May 21, 2007 Posted May 21, 2007 compiled continue.au3: http://www.msfn.org/board/Gaaaah_sysprep_l...st&p=555535
jeremyotten Posted May 22, 2007 Author Posted May 22, 2007 Ok the thing that we need to find out is. Why this long process of adding drivers to de massstorage section. Why not just do it for windows... but how?What process in taking place in the registry or files changes? when sysprep is run with this option?IcemanND any idea on tracking this?
IcemanND Posted May 22, 2007 Posted May 22, 2007 just ran sysprep on a vm, adding the massstorage controllers into the criticaldevicesdatabase key via sysprep with only the windows drivers resulted in adding 667 sub-keys. That doesn't include the associated values.Probably can be done using either setupaip.dll or advpack.dll, but is it worth it? Could we do it any faster than sysprep already does?
jeremyotten Posted May 26, 2007 Author Posted May 26, 2007 (edited) What I already tried was this.use SetupCopyOEMInf.exe to add the massstorage drivers to the windows\inf dir. this goes very fast even faster when you use your continue.exeonly I expected sysprep to now automatically add these to the massstorage section when I do sysprep -bmsd but this isn't the case. Sysprep seems to get this info from the machine.inf file and another inf file........ so maybe if we could add extra drivers to these machine.inf file we goed make the process faster.... what do you think?P.s what was the critical devices key you found?p.p.s Also I need a script that changes the HAL to standard PC HAL. Writes a key in the runonce to a script which updates the hal after image deployment backup to the right hal. Edited May 27, 2007 by jeremyotten
IcemanND Posted May 28, 2007 Posted May 28, 2007 when you run sysprep and build the mass storage section it adds all of those devices to the critical devices database in the registry. HKLM\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase
jeremyotten Posted May 28, 2007 Author Posted May 28, 2007 (edited) OK I got the whole process automated with some help of you scripts and continue.exe files (had to change it so be compatible with dutch OS)But. Are you able to add the entire www.driverpacks.net massstorage package with this method?If yes please tell me how. Because sysprep seems to not be able to complete its process. And because I run it queit no error is displayed...I got the error the error is "An Error occured while trying to update your registry"Reseal machine failed!I found an article which claims its a faulty entry in the massstorage sectionhttp://support.microsoft.com/kb/249690Im looking at it know If I can find the entry (this is alot of work) Maybe if you already know which one it is. Please share....;-) Edited May 28, 2007 by jeremyotten
IcemanND Posted May 29, 2007 Posted May 29, 2007 I manully start off my scripts but this could be automated.Create a scheduled task for an interactive CMD window which starts one minute from current time. The command window runs under the System user account. Then run sysprep from this CMD window and you won't get that error.This problem is supposedly related to a registry permissions issue but I never managed to find out just what caused it.
jeremyotten Posted May 29, 2007 Author Posted May 29, 2007 (edited) Can you tell me how to script and automate this scheduled task?You would greatly help because im trying to make a 100 percent automated cdmaybe you can do something with this:http://blogs.msdn.com/adioltean/articles/271063.aspxOK after scripting myself silly I created this (should would right? or do you have a better option?)@ECHO OFFREM ---- SET HOURS BASED on 24U CLOCK------time /t|FIND "01:">NULIF not ERRORLEVEL==1 SET UU=01time /t|FIND "02:">NULIF not ERRORLEVEL==1 SET UU=02time /t|FIND "03:">NULIF not ERRORLEVEL==1 SET UU=03time /t|FIND "04:">NULIF not ERRORLEVEL==1 SET UU=04time /t|FIND "05:">NULIF not ERRORLEVEL==1 SET UU=05time /t|FIND "06:">NULIF not ERRORLEVEL==1 SET UU=06time /t|FIND "07:">NULIF not ERRORLEVEL==1 SET UU=07time /t|FIND "08:">NULIF not ERRORLEVEL==1 SET UU=08time /t|FIND "09:">NULIF not ERRORLEVEL==1 SET UU=09time /t|FIND "10:">NULIF not ERRORLEVEL==1 SET UU=10time /t|FIND "11:">NULIF not ERRORLEVEL==1 SET UU=11time /t|FIND "12:">NULIF not ERRORLEVEL==1 SET UU=12time /t|FIND "13:">NULIF not ERRORLEVEL==1 SET UU=13time /t|FIND "14:">NULIF not ERRORLEVEL==1 SET UU=14time /t|FIND "15:">NULIF not ERRORLEVEL==1 SET UU=15time /t|FIND "16:">NULIF not ERRORLEVEL==1 SET UU=16time /t|FIND "17:">NULIF not ERRORLEVEL==1 SET UU=17time /t|FIND "18:">NULIF not ERRORLEVEL==1 SET UU=18time /t|FIND "19:">NULIF not ERRORLEVEL==1 SET UU=19time /t|FIND "20:">NULIF not ERRORLEVEL==1 SET UU=20time /t|FIND "21:">NULIF not ERRORLEVEL==1 SET UU=21time /t|FIND "22:">NULIF not ERRORLEVEL==1 SET UU=22time /t|FIND "23:">NULIF not ERRORLEVEL==1 SET UU=23time /t|FIND "00:">NULIF not ERRORLEVEL==1 SET UU=00REM --- SET AT 1 MINUTE AHEAD -----time /t|FIND ":00">NULIF not ERRORLEVEL==1 at %UU%:01 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":01">NULIF not ERRORLEVEL==1 at %UU%:02 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":02">NULIF not ERRORLEVEL==1 at %UU%:03 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":03">NULIF not ERRORLEVEL==1 at %UU%:04 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":04">NULIF not ERRORLEVEL==1 at %UU%:05 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":05">NULIF not ERRORLEVEL==1 at %UU%:06 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":06">NULIF not ERRORLEVEL==1 at %UU%:07 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":07">NULIF not ERRORLEVEL==1 at %UU%:08 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":08">NULIF not ERRORLEVEL==1 at %UU%:09 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":09">NULIF not ERRORLEVEL==1 at %UU%:10 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":10">NULIF not ERRORLEVEL==1 at %UU%:11 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":11">NULIF not ERRORLEVEL==1 at %UU%:12 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":12">NULIF not ERRORLEVEL==1 at %UU%:13 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":13">NULIF not ERRORLEVEL==1 at %UU%:14 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":14">NULIF not ERRORLEVEL==1 at %UU%:15 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":15">NULIF not ERRORLEVEL==1 at %UU%:16 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":16">NULIF not ERRORLEVEL==1 at %UU%:17 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":17">NULIF not ERRORLEVEL==1 at %UU%:18 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":18">NULIF not ERRORLEVEL==1 at %UU%:19 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":19">NULIF not ERRORLEVEL==1 at %UU%:20 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":20">NULIF not ERRORLEVEL==1 at %UU%:21 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":21">NULIF not ERRORLEVEL==1 at %UU%:22 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":22">NULIF not ERRORLEVEL==1 at %UU%:23 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":23">NULIF not ERRORLEVEL==1 at %UU%:24 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":24">NULIF not ERRORLEVEL==1 at %UU%:25 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":25">NULIF not ERRORLEVEL==1 at %UU%:26 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":26">NULIF not ERRORLEVEL==1 at %UU%:27 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":27">NULIF not ERRORLEVEL==1 at %UU%:28 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":28">NULIF not ERRORLEVEL==1 at %UU%:29 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":29">NULIF not ERRORLEVEL==1 at %UU%:30 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":30">NULIF not ERRORLEVEL==1 at %UU%:31 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":31">NULIF not ERRORLEVEL==1 at %UU%:32 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":32">NULIF not ERRORLEVEL==1 at %UU%:33 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":33">NULIF not ERRORLEVEL==1 at %UU%:34 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":34">NULIF not ERRORLEVEL==1 at %UU%:35 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":35">NULIF not ERRORLEVEL==1 at %UU%:36 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":36">NULIF not ERRORLEVEL==1 at %UU%:37 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":37">NULIF not ERRORLEVEL==1 at %UU%:38 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":38">NULIF not ERRORLEVEL==1 at %UU%:39 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":39">NULIF not ERRORLEVEL==1 at %UU%:40 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":40">NULIF not ERRORLEVEL==1 at %UU%:41 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":41">NULIF not ERRORLEVEL==1 at %UU%:42 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":42">NULIF not ERRORLEVEL==1 at %UU%:43 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":43">NULIF not ERRORLEVEL==1 at %UU%:44 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":44">NULIF not ERRORLEVEL==1 at %UU%:45 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":45">NULIF not ERRORLEVEL==1 at %UU%:46 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":46">NULIF not ERRORLEVEL==1 at %UU%:47 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":47">NULIF not ERRORLEVEL==1 at %UU%:48 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":48">NULIF not ERRORLEVEL==1 at %UU%:49 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":49">NULIF not ERRORLEVEL==1 at %UU%:50 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":50">NULIF not ERRORLEVEL==1 at %UU%:51 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":51">NULIF not ERRORLEVEL==1 at %UU%:52 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":52">NULIF not ERRORLEVEL==1 at %UU%:53 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":53">NULIF not ERRORLEVEL==1 at %UU%:54 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":54">NULIF not ERRORLEVEL==1 at %UU%:55 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":55">NULIF not ERRORLEVEL==1 at %UU%:56 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":56">NULIF not ERRORLEVEL==1 at %UU%:57 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":57">NULIF not ERRORLEVEL==1 at %UU%:58 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":58">NULIF not ERRORLEVEL==1 at %UU%:59 /interactive "C:\sysprep\sysprep.bat"time /t|FIND ":59">NULIF not ERRORLEVEL==1 at %UU%:00 /interactive "C:\sysprep\sysprep.bat"UPDATE 30/5/2007THE SCRIPT WORKS! gheghe thanks for the info. Only problem when I boot the system I get a nvata.sys loading error (NVIDIA? don't have it in my system) removed the D\M\N drivers from the process. And I am trying again... Edited May 30, 2007 by IcemanND
jeremyotten Posted May 30, 2007 Author Posted May 30, 2007 OK I got rid of the nvata.sys error.BUT NOW! I get an ntfs.sys error when loading windows after sysprep resealed it. Help is very needed!Thanx in Advance
IcemanND Posted May 30, 2007 Posted May 30, 2007 hate to say it but the only time I have ever seen that error it had to do with a failing hard drive.Yes there is an easier way that that monster script of yours. I'm working on it now and will post it later.
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