bigfoot wrote:Glad it worked. As for the -clean, I have never got it to work. It should clean out the critical database list to the default list from xp + whatever storage controller is installed. I would just leave it alone. If you ever have to pull the hard drive out and place it in another (not exact config) computer, you will want those items in the database so you can boot. It could be a life/time saver.
Ok, here we go. I'll explain how to get "sysprep -clean" work, or maybe how it work for me, and will post some addition command line to clean out the rest of drivers.
The purpose - is to have fully cleaned up, after masstorage section got worked out.
How to make "sysprep -clean" work:
1. Go to the "SYSPREP" folder and create "I386" folder inside
2. Inside new "I386" create "$OEM$" folder
3. Inside new "$OEM$" folder create file "cmdlines.txt" with such content
4. Inside new "$OEM$" folder create file "runonce.cmd" with such content
SETLOCAL ENABLEDELAYEDEXPANSION
CHDIR /D "%SYSTEMDRIVE%\SYSPREP"
START "Sysprep Clean" /WAIT "SYSPREP.EXE" -clean
START "Pause" /MIN /WAIT "ping.exe" -n 10 localhost
ENDLOCAL
Ok, this must looks familiar to all of you, who deal with unattended install
After we done all of this, we go back to our SYSPREP folder, open up our SYSPREP.INF file and add/edit this section:
[Unattended]
InstallFilesPath = "C:\SYSPREP\I386"
Note, that you CAN NOT use environment variables in "InstallFilesPath" parameters
After all this done we will get our "runonce.cmd" launched on the final phase of Mini-Setup and sysprep will clean up unused drivers.
And some additional phase if you use this bigfoot's Driverpack. This batch will clean out unnecessary drivers, which are installed NOT DIRECTLY from sysprep Massstorage section, these were installed by the corresponding inf's and still took place in system after sysprep cleanup.
For less words here my "runonce.cmd" from thet step 4:
SETLOCAL ENABLEDELAYEDEXPANSION
:: Starting previously disable intellppm driver if Intel Processor found
ECHO %PROCESSOR_IDENTIFIER% | findstr.exe /I "intel"
IF "%ERRORLEVEL%" == "0" (sc.exe config intelppm start= system)
CHDIR /D "%SYSTEMDRIVE%\SYSPREP"
:: Starting Sysprep Clean
START "Sysprep Clean" /WAIT "SYSPREP.EXE" -clean
START "Pause" /MIN /WAIT "ping.exe" -n 10 localhost
:: Finishing driverpacks install
CHDIR /D "%SystemDrive%\"
START /WAIT /SEPARATE /HIGH "Driverpacks Finisher" "DPsFnshr.exe"
START "Pause" /MIN /WAIT "ping.exe" -n 10 localhost
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Cleaning up unnecessary drivers
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\fasttx2k" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x4] START "Delete Registry Value" /WAIT "reg.exe" DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "Ptipbmf" /f
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\ulsata2" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x4] (
START "Delete Registry Value" /WAIT "reg.exe" DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run" /v "PtiuPbmd" /f
FOR /F "tokens=3" %%i IN ('reg.exe QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" ^| FINDSTR "UpperFilters"') DO SET "UpperFilters=%%i"
SET "UpperFilters=!UpperFilters:DontGo\0=!"
SET "UpperFilters=!UpperFilters:\0\0=\0!" & SET "UpperFilters=!UpperFilters:\0\0=\0!"
IF [!UpperFilters!]==[\0] (
reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /f
) ELSE (
reg.exe ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /t "REG_MULTI_SZ" /d "!UpperFilters!" /f
)
START "Disable Additional Service" /WAIT "sc.exe" CONFIG dontgo start= disabled
)
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\SI3112" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x4] (
FOR /F "tokens=3" %%i IN ('reg.exe QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" ^| FINDSTR "UpperFilters"') DO SET "UpperFilters=%%i"
SET "UpperFilters=!UpperFilters:SiRemFil\0=!"
SET "UpperFilters=!UpperFilters:\0\0=\0!" & SET "UpperFilters=!UpperFilters:\0\0=\0!"
IF [!UpperFilters!]==[\0] (
reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /f
) ELSE (
reg.exe ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E967-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /t "REG_MULTI_SZ" /d "!UpperFilters!" /f
)
FOR /F "tokens=3" %%i IN ('reg.exe QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" ^| FINDSTR "UpperFilters"') DO SET "UpperFilters=%%i"
SET "UpperFilters=!UpperFilters:SiRemFil\0=!"
SET "UpperFilters=!UpperFilters:\0\0=\0!" & SET "UpperFilters=!UpperFilters:\0\0=\0!"
IF [!UpperFilters!]==[\0] (
reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /f
) ELSE (
reg.exe ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E965-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /t "REG_MULTI_SZ" /d "!UpperFilters!" /f
)
START "Disable Additional Service" /WAIT "sc.exe" CONFIG SiRemFil start= disabled
START "Disable Additional Service" /WAIT "sc.exe" CONFIG SiFilter start= disabled
)
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\SI3114" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x0] START "Delete Additional Service" /WAIT "sc.exe" CONFIG SiFilter start= system
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\videX32" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x4] (
FOR /F "tokens=3" %%i IN ('reg.exe QUERY "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" ^| FINDSTR "UpperFilters"') DO SET "UpperFilters=%%i"
SET "UpperFilters=!UpperFilters:xfilt\0=!"
SET "UpperFilters=!UpperFilters:\0\0=\0!" & SET "UpperFilters=!UpperFilters:\0\0=\0!"
IF [!UpperFilters!]==[\0] (
reg.exe DELETE "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /f
) ELSE (
reg.exe ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4D36E96A-E325-11CE-BFC1-08002BE10318}" /v "UpperFilters" /t "REG_MULTI_SZ" /d "!UpperFilters!" /f
)
START "Disable Additional Service" /WAIT "sc.exe" CONFIG xfilt start= disabled
)
FOR /F "tokens=3" %%i IN ('reg.exe query "HKLM\SYSTEM\CurrentControlSet\Services\nvata" /v "Start" ^| FINDSTR "Start"') DO SET "DriverStartType=%%i"
IF [%DriverStartType%]==[0x4] (
PUSHD "%SystemRoot%\system32"
START "Uninstall Nvidia IDE" "nvuide.exe" Run nvide.nvu
START "Pause" /MIN /WAIT "ping.exe" -n 10 localhost
ERASE /F /Q nvide.nvu
reg.exe DELETE "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\NVIDIA Drivers" /f
POPD
)
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: End Cleaning section
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
ENDLOCAL
I'll explain as simple as I can what's going on in CLEANING section.
As soon as I got it right, sysprep is doing simple stuff in it's cleaup procedure it checks whether or not some of drivers, that were previously in sysprep masstorage section are in use, and if not - it just deletes the entry.
But some drivers install addition drivers with their inf's. These are:
fasttx2k - installs autorun section for it's dll "Ptipbmf"
ulsata2 - installs autorun section for it's dll "PtiuPbmd" and install it's dontgo.sys which is lately registred as upperfilter
SI3112 - install it's SiRemFil.sys which is lately registred as upperfilter, and install SiFilter
SI3114 - install SiFilter
nvata - install's additional software
Just be carefull these additional drivers my become registred as Upperfilters in HDD, CD sections and i think this should be cleanup. Well, you can use my batch, it's well tested and works fine. But currently i'm not delete entrys for these additional files just disable them for start. Keep working...
Thank you bigfoot for that pack, works like a charm, just dreamin about an update =) Or maybe just an explanation of how can I know which driver from DriverPack MassStorage section will work with XP sysprep masstorage, and which will not?
Last edited by zawakened (2013-09-23 17:52:28)