x23piracy Posted March 17, 2013 Share Posted March 17, 2013 (edited) Hi, i made that little script for my own to handle winpe images: Requires: The Windows® Automated Installation Kit (AIK) for Windows® 7 Download: PEX23 Code: @echo offREM Force umount, uncomment temporary the right line for your arch if you fataly closed the batch procese while an image was mounted and not unmounted ;)REM "%programfiles%\Windows AIK\Tools\amd64\Servicing\Dism.exe" /Unmount-Wim /MountDir:"%cd%\WinPE_amd64\mount" /CommitREM "%programfiles%\Windows AIK\Tools\x86\Servicing\Dism.exe" /Unmount-Wim /MountDir:"%cd%\WinPE_x86\mount" /Commitecho.echo Choose Architecture for the PE Folder to createecho.choice /n /c "46" /m "amd6(4), x8(6)?"if errorlevel 2 goto x86if errorlevel 1 goto amd64:amd64SET ARCH=amd64IF EXIST "%cd%\WinPE_%ARCH%" GOTO existscall "%programfiles%\Windows AIK\Tools\PETools\copype.cmd" %ARCH% "WinPE_%ARCH%"cd ..goto mount:x86SET ARCH=x86IF EXIST "%cd%\WinPE_%ARCH%" GOTO existscall "%programfiles%\Windows AIK\Tools\PETools\copype.cmd" %ARCH% "WinPE_%ARCH%"cd ..goto mount:existsclsecho.echo Directory for choosen Architecture allready existsecho Mount or delete existing directory or abort?echo. choice /n /c "MDA" /m "(M)ount, (D)elete, (A)bort?" if errorlevel 3 goto abort if errorlevel 2 goto delPE if errorlevel 1 goto mount:abortExit:delPErd /s /q "%cd%\WinPE_%ARCH%"goto %ARCH%:mountcls"%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Mount-Wim /WimFile:"%cd%\WinPE_%ARCH%\winpe.wim" /Index:1 /MountDir:"%cd%\WinPE_%ARCH%\mount"echo.echo You can now start customizing the image,echo press any key if you have finished.echo.pauseclsecho.echo Do you want to integrate drivers?echo. choice /n /c "YN" /m "(Y)es, (N)o?" if errorlevel 2 goto umount if errorlevel 1 goto intdrv:intdrvIF NOT EXIST "%cd%\WinPE_%ARCH%\Drivers" GOTO missingcolor 0Fclsecho.echo Do you want to integrate unsigned drivers?echo. choice /n /c "YN" /m "(Y)es, (N)o?" if errorlevel 2 SET drvmode= if errorlevel 1 SET drvmode=/Forceunsigned"%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" "/Image:%cd%\WinPE_%ARCH%\mount" /Add-Driver "/Driver:%cd%:\WinPE_%ARCH%\Drivers" /Recurse %drvmode%clsecho.echo Driver integration finished, unmounting now.goto umount:missingclscolor FCecho.echo The following path doesn't exist:echo.echo %cd%\WinPE_%ARCH%\Driversecho.echo Create the directory and place your drivers there.echo.pausegoto intdrv:umountecho."%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Unmount-Wim /MountDir:"%cd%\WinPE_%ARCH%\mount" /Commitclsecho.echo Unmouting the Image has been finished.echo Do you want to create an ISO from the PE folder?echo. choice /n /c "YN" /m "(Y)es, (N)o?" if errorlevel 2 goto finished if errorlevel 1 goto iso:finishedecho.echo Finishedtimeout /T 3 /nobreakExit:isocopy "%cd%\WinPE_%ARCH%\winpe.wim" "%cd%\WinPE_%ARCH%\ISO\sources\boot.wim"cls"%programfiles%\Windows AIK\Tools\%ARCH%\oscdimg.exe" -n -b"%cd%\WinPE_%ARCH%\etfsboot.com" "%cd%\WinPE_%ARCH%\ISO" "%cd%\WinPE_%ARCH%\WinPE_%ARCH%.iso"echo.echo Finishedtimeout /T 3 /nobreakExit Screenshots: Update: - Added the missing " for driver integration thx @mr_smartepants- Added a dialog that asks for unsigned driver integration- Removed ²³ from file and foldernames because of errors- Added a dialog that asks for integration of a prepared folder with files to add to the pe image- Moved Drivers Folder to %cd% ToDo: - Dialog that asks for integration of a prepared folder with files to add to the pe image- For PXE use, Dialog that ask for data (credentials) to mount a network share to start a windows setup after pe has booted- A General Dialog that asks for a file to execute after pe has booted- Move Drivers Folder Destination to %cd% because it's a bit boring the always renew the Drivers folder while testing This should only work complete under Windows 7 x64 and maybe Windows 8 x64 no way for Windows XP.If anyone finds it usefull, have fun with it Greetz X23 Edited March 17, 2013 by x23piracy Stimpy 1 Quote Link to comment Share on other sites More sharing options...
Mr_Smartepants Posted March 17, 2013 Share Posted March 17, 2013 "%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Image:"%cd%\WinPE_%ARCH%\mount" /Add-Driver /Driver:"%cd%:\WinPE_%ARCH%\Drivers /Recurse This line is missing the end quote from the /Driver: path.Should be: "%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Image:"%cd%\WinPE_%ARCH%\mount" /Add-Driver /Driver:"%cd%:\WinPE_%ARCH%\Drivers" /Recurse Stimpy 1 Quote Link to comment Share on other sites More sharing options...
alfreire Posted March 17, 2013 Share Posted March 17, 2013 Thanks, I'll try...Regards... ;-) Quote Link to comment Share on other sites More sharing options...
x23piracy Posted March 17, 2013 Author Share Posted March 17, 2013 Hi, "%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Image:"%cd%\WinPE_%ARCH%\mount" /Add-Driver /Driver:"%cd%:\WinPE_%ARCH%\Drivers /Recurse This line is missing the end quote from the /Driver: path.Should be: "%programfiles%\Windows AIK\Tools\%ARCH%\Servicing\Dism.exe" /Image:"%cd%\WinPE_%ARCH%\mount" /Add-Driver /Driver:"%cd%:\WinPE_%ARCH%\Drivers" /Recurse thx i was making the batch working from anywhere so i missed it Greetz X23 Quote Link to comment Share on other sites More sharing options...
x23piracy Posted March 17, 2013 Author Share Posted March 17, 2013 (edited) Update: - Added the missing " for driver integration thx @mr_smartepants- Added a dialog that asks for unsigned driver integration- Removed ²³ from file and foldernames because of errors ToDo: - Dialog that asks for integration of a prepared folder with files to add to the pe image- For PXE use, Dialog that ask for data (credentials) to mount a network share to start a windows setup after pe has booted- A General Dialog that asks for a file to execute after pe has booted- Move Drivers Folder Destination to %cd% because it's a bit boring the always renew the Drivers folder while testing Download: See first post. Greetz X23 Edited March 17, 2013 by x23piracy Quote Link to comment Share on other sites More sharing options...
x23piracy Posted March 17, 2013 Author Share Posted March 17, 2013 Update: - Added a dialog that asks for integration of a prepared folder with files to add to the pe image- Moved Drivers Folder to %cd% ToDo: - Dialog that asks for integration of a prepared folder with files to add to the pe image- For PXE use, Dialog that ask for data (credentials) to mount a network share to start a windows setup after pe has booted- A General Dialog that asks for a file to execute after pe has booted- Move Drivers Folder Destination to %cd% because it's a bit boring the always renew the Drivers folder while testing Download: See first post. Greetz X23 Stimpy 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.