My script I made for win7 pe a while ago looks for the macrium iso first. If found %systemdrive%\Boot\macrium\WA10KFiles\media\sources\boot.wim\Program Files\macrium is extracted. Then the unwanted stuff is deleted e.g. launch.exe, peexplorer.exe,taskbar.exe, textedit.exe. That macrium folder can be popped into the existing wim file using wimlib ( which I have been using for a long while). Only takes a few seconds.
You can knock up a .cmd file to do it. If you want to include a browse to wim function - you use my modified pecmd.exe. You have copies of that. You are using it in your winpe. Look at the help file I painstakingly put in it.
Code:
┣━━┿━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━┫
┃ │ format │BROW <variable name>, [[* | &] initial path],[prompt text],[extension name],[notation] ┃
┃ ├──┼───────────────────────────────────────────── ─┨
┃ │ │ browse function disk files and directories. ┃
┃ ├──┼───────────────────────────────────────────── ─┨
┃ │ │ ■ variable parameters Name:to save the browse results variable name. ┃
┃ │ │ ■ initial path:the default for the browser window, select the file or directory, when this parameter is omitted navigate to the system default path; leading character "*" for Liu ┃
┃ │ │ browse the directory dialog box, leading "&" to save the file dialog for Open File dialog box preamble omitted. ┃
┃ │ │ ■ Tip Text:can be omitted, the default text is omitted, the default text prompts. ┃
┃ │ │ ■ Extension Name:Browse to specify the file extension, omitting all of the files. ┃
┃BROW│ │ ■ notations:browse the directory dialog interface style is set, the default is "no [edit box], there [New Folder] button does not display files", ┃
┃ │ │ edit box marked as 0x10, no New Folder button flag 0x200, display files marked as 0x4000, to simultaneously ┃
┃ │ │ set a variety of styles, use these flag values "or" operational value or values of these flags. ┃
┃ ├──┼───────────────────────────────────────────── ─┨
┃ │ example │BROW Boot_Ini,C:\Windiws\BOOT.INI,please select a file, INI or BROW Tag,*C:\Windiws, please select a directory ┃
┃ ├──┼───────────────────────────────────────────── ─┨
┃ │ │ ※ selection results will be saved in the specified process environment variable. Example 2 can be referenced by the environment variable %Tag%. ┃
┃ │ │ ※ BROW command must be executed in a desktop or after the INIT command. ┃
┣━━┿━━┿━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ ━━━┫