Jump to content

Recommended Posts

Posted (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:

 

3oR9X0x.png

 

YUELVf7.png

 

r8GAgys.png

 

txKDpf9.png

 

lhwfG6c.png

 

qsJsP46.png

 

VJtAKD7.png

 

UCxCqh4.png

jAM9L5r.png

 

QQ6Xd2T.png

 

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 by x23piracy
Posted
"%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 
Posted

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 :D

 

 

Greetz X23

Posted (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 by x23piracy
Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...