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

LOGS %WinDir%\System32\Pecmd.log

CALL OSInit
CALL PreShell
CALL Shortcuts
CALL PinTo
CALL LoadShell
CALL PostShell
CALL AudioInit
CALL NetInit
TIPS  The system configuration is finished.,,1,#1
WAIT 3000
EXIT

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

// 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 W1366 H768 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

// winpeshl.ini with [LaunchApps] wpeinit.exe
EXEC %WinDir%\System32\winpeshl.exe

// EXEC %WinDir%\System32\wpeinit.exe

// EXEC %WinDIr%\System32\cmd.exe

// LetterSwap
// EXEC =!%WinDir%\System32\LetterSwap.exe /auto /bootdrive Y:\CDUsb.y /Log %WinDir%\System32\LetterSwap.log

// Fix Screen resolution and Show Desktop. NoWait Hide
// EXEC !%WinDir%\System32\FixScreen.exe

// Load oem drivers before shell in background
// EXEC @!%WinDir%\System32\pnputil.exe /add-driver %WinDir%\inf\oem*.inf

INIT IU,3000

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB Shortcuts


LINK %Programs%\File Tasks\Explorer,%WinDir%\Explorer.exe
LINK %Programs%\Explorer,%WinDir%\Explorer.exe
LINK %Desktop%\Explorer,%WinDir%\Explorer.exe

LINK %Programs%\Registry\Regedit,%WinDir%\regedit.exe

LINK %Programs%\Administrative Tools\Computer Management,%WinDir%\System32\compmgmt.msc
LINK %Programs%\Administrative Tools\Device Manager,%WinDir%\System32\devmgmt.msc
LINK %Programs%\Administrative Tools\Disk Management,%WinDir%\System32\diskmgmt.msc
LINK %Programs%\Administrative Tools\Services,%WinDir%\System32\services.msc

LINK %Desktop%\Command Prompt,%WinDir%\System32\cmd.exe
LINK %Programs%\System Tools\Command Prompt,%WinDir%\System32\cmd.exe

LINK %Programs%\System Tools\Regedit,%WinDir%\regedit.exe


LINK %Desktop%\Internet Explorer,%ProgramFiles%\Internet Explorer\iexplore.exe
LINK %Programs%\Network\Internet Explorer,%ProgramFiles%\Internet Explorer\iexplore.exe

LINK %Desktop%\PENetwork,%ProgramFiles%\PENetwork\PENetwork.exe
LINK %Programs%\Network\PENetwork,%ProgramFiles%\PENetwork\PENetwork.exe



_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB PinTo

//PINT xxx.exe,StartMenu (does not work with SIB)
// Examples here. It is done with PinTool, see the section below
//PINT %WinDir%\System32\cmd.exe,TaskBand
//PINT %Programs%\Explorer.lnk,TaskBand
//PINT %ProgramFiles%\Q-Dir\Q-Dir.exe,TaskBand

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

IFEX %WinDir%\System32\ctfmon.exe, EXEC %WinDir%\System32\ctfmon.exe

//EXP_SHEL %WinDir%\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

// Hide start menu Startup folders
EXEC !%WinDir%\System32\attrib.exe +s +h "X:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup"
EXEC !%WinDir%\System32\attrib.exe +s +h "X:\Users\Default\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup"

// Remove desktop.ini
IFEX %Desktop%\desktop.ini,FILE %Desktop%\desktop.ini
IFEX X:\Users\Default\Desktop\desktop.ini,FILE X:\Users\Default\Desktop\desktop.ini
IFEX X:\Users\Public\Desktop\desktop.ini,FILE X:\Users\Public\Desktop\desktop.ini
IFEX X:\Users\Administrator\Desktop\desktop.ini,FILE X:\Users\Administrator\Desktop\desktop.ini

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

// PinTool must be Launched after Explorer
// EXEC %WinDir%\System32\PinTool.exe -debug %Windir%\System32\Pecmd.ini

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB AudioInit

//SERV -wait Audiosrv (audio service already started)
//Install HDAudio driver sound cards
DEVI %WinDir%\inf\hdaudio.inf
WAIT 250

//Adjust the volume (windows default 67%) ex: 65535*33% = 21626
//EXEC=!%WinDir%\System32\nircmd.exe setsysvolume 21626

//Startup sound
//EXEC @!%WinDir%\System32\mpg123.exe -q %SystemRoot%\Media\startup.mp3

_END
////////////////////////////////////////////////////////////////////////////////////////////////
_SUB NetInit

EXEC !%WinDir%\System32\InitializeNetwork.cmd
// Load Network drivers at startup
//ARCH_x64_EXEC =@!%WinDir%\System32\Drvload.exe %WinDir%\inf\athw8x.inf %WinDir%\inf\netathr10x.inf %WinDir%\inf\netathrx.inf %WinDir%\inf\netbc63a.inf %WinDir%\inf\netbc64.inf %WinDir%\inf\netrtwlane.inf %WinDir%\inf\netrtwlane_13.inf %WinDir%\inf\netrtwlanu.inf %WinDir%\inf\netwbw02.inf %WinDir%\inf\netwew00.inf %WinDir%\inf\netwew01.inf %WinDir%\inf\netwlan92de.inf %WinDir%\inf\netwlv64.inf %WinDir%\inf\netwns64.inf %WinDir%\inf\netwsw00.inf %WinDir%\inf\netwtw02.inf %WinDir%\inf\netwtw04.inf %WinDir%\inf\netwtw06.inf
//ARCH_x86_EXEC =@!%WinDir%\System32\Drvload.exe %WinDir%\inf\athw8.inf %WinDir%\inf\netathr.inf %WinDir%\inf\netathr10.inf %WinDir%\inf\netbc63.inf %WinDir%\inf\netbc64.inf %WinDir%\inf\netrtwlane.inf %WinDir%\inf\netrtwlane_13.inf %WinDir%\inf\netrtwlanu.inf %WinDir%\inf\netwbn02.inf %WinDir%\inf\netwen00.inf %WinDir%\inf\netwen01.inf %WinDir%\inf\netwlan92de.inf %WinDir%\inf\netwlv32.inf %WinDir%\inf\netwns32.inf %WinDir%\inf\netwsn00.inf %WinDir%\inf\netwtn02.inf %WinDir%\inf\netwtn04.inf

EXEC @!%WinDir%\System32\Net.exe Start Wlansvc
EXEC @!%WinDir%\System32\Net.exe Start WinHttpAutoProxySvc

// Launch PENetwork
EXEC %ProgramFiles%\PENetwork\PENetwork.exe

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

[PINTOOL]
StartMenu0=%WinDir%\Explorer.exe||||||||
StartMenu1=$Start_Menu\Programs\Network\Internet Explorer.lnk||||||||
TaskBar0=%SystemRoot%\System32\cmd.exe||||||||
TaskBar8=$Start_Menu\Programs\Network\Internet Explorer.lnk||||||||
TaskBar9=%SystemRoot%\Explorer.exe||||||||
