// Pecmd launched from : RegWrite,HKLM,0x1,Tmp_System\Setup,CmdLine,"Pecmd.exe Main #$pWindir#$p\System32\Pecmd.ini"

LOGS %WinDir%\System32\Pecmd.%USERNAME%.log

CALL OSInit
CALL PreShell
CALL LoadShell
CALL PostShell

TIPS  The system configuration is finished.,,1,#1
WAIT 3000
EXIT

////////////////////////////////////////////////////////////////////////////////////////////////
_SUB OSInit

// winpeshl.ini with [LaunchApps] wpeinit.exe
IFEX %WinDir%\System32\winpeshl.log,!EXEC %WinDir%\System32\winpeshl.exe
// EXEC %WinDir%\System32\wpeinit.exe

// Load Display drivers
// EXEC =@!%WinDir%\System32\Drvload.exe %WinDir%\inf\basicdisplay.inf %WinDir%\inf\basicrender.inf %WinDir%\inf\c_display.inf %WinDir%\inf\display.inf %WinDir%\inf\displayoverride.inf

TEAM DISP W1024 H768 B32|DISP W1280 720 B32
//TEAM DISP W1024 H768 B32|DISP W1280 720 B32|DISP W1280 H1024 B32|DISP W1366 H768 B32|DISP W1920 H1080 B32
LOGO %WinDir%\web\wallpaper\Windows\img0.jpg
NUMK 1
TEXT System configuration, Please Wait...#0xFFFFFF L59 T39 $20*
// TIPS  System configuration, Please Wait..,,1,#1

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB PreShell

EXEC =!"X:\PEMaterial\Autoruns\PEStartupMain.bat" OSInit
INIT IU,3000

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB DaemonShell
// FIND %~1=explorer.exe,SET shell_cmd=PECMD EXEC -HOOK explorer.exe,!SET shell_cmd=%~1 %~2 %~3
FIND $%USERNAME%<>SYSTEM,EXEC %ProgramFiles%\WinXShell\WinXShell.exe -luacode "shel([[%~1 %~2 %~3]])"!SHEL %~1 %~2 %~3

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB LoadShell

IFEX %WinDir%\System32\ctfmon.exe, EXEC PECMD.exe EXEC -su %WinDir%\System32\ctfmon.exe
EXEC =!"X:\PEMaterial\Autoruns\PEStartupMain.bat" BeforeShell

//EXP_SHEL explorer.exe
//WXS_SHEL "%ProgramFiles%\WinXShell\WinXShell.exe" -regist -winpe
//EXP_EXEC !%ProgramFiles%\WinXShell\WinXShell.exe -regist -daemon

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB PostShell

// Dism can't mount in SYSTEM without workgroup
// CALL $Netapi32.dll,NetJoinDomain,,WORKGROUP,,,,1

LOGO
// EXEC  = Wait, @background, ! Hide. ex: EXEC =WaitNoHide.cmd, EXEC @!=WaitHide.cmd, EXEC NoWaitNoHide.cmd, EXEC @!NoWaitHide.cmd

EXEC =%ProgramFiles%\WinXShell\WinXShell.exe -luacode Taskbar:WaitForReady()
EXEC !"X:\PEMaterial\Autoruns\PEStartupMain.bat" PostShell

// Load drivers
//DEVI %WinDir%\inf\battery.inf
//DEVI %WinDir%\inf\usbport.inf

_END
////////////////////////////////////////////////////////////////////////////////////////////////
