SET Var0=%0
IF '^%Var0:~0,1%'=='^"' SET Var0=%Var0:~1,-1%
FOR /f "delims=" %%I in ("%Var0%") do Set TP=%%~dpI
SET TP=%TP:~0,-1%
PUSHD %TP%

IF NOT EXIST %SystemRoot%\System32\NEWDEV.DLL PECMD.EXE EXEC ="%TP%\Outer_Base.EXE"

PECMD.EXE EXEC ="%TP%\Net_Part.exe"
FOR /F %%i IN ('Dir /B /A-D ^"%TP%\DRIVERS_NET*.CAB^"') DO PECMD.EXE DEVI "%TP%\%%i"
START /Wait .\InfCacheBuild.exe %SystemRoot%
BARTPE.EXE -pnp

PECMD.EXE EXEC @REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /va /f
PECMD.EXE EXEC @REG DELETE HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce /va /f

NET START EVENTLOG
ECHO 安装网络设备...
BARTPE -pnp -cn WinPE -wg WORKGROUP

ECHO 安装网络组件...
REGSVR32 /S NETCFGX.DLL
REGSVR32 /S NETSHELL.DLL
REGSVR32 /S NETMAN.DLL

BARTPE -c p -i MS_TCPIP

BARTPE -c c -i MS_MSCLIENT
BARTPE -c s -i MS_SERVER

BARTPE -c p -i MS_L2TP
BARTPE -c p -i MS_PPTP
BARTPE -c p -i MS_PPPOE
BARTPE -c p -i MS_WANARP
BARTPE -c p -i MS_NDISWAN

BARTPE -c s -i MS_RASCLI
BARTPE -c s -i MS_RASSRV
BARTPE -c s -i MS_RASMAN
BARTPE -c s -i MS_STEELHEAD

BARTPE -v -c p -i MS_NDISUIO
BARTPE -v -c s -i MS_WZCSVC

ECHO 启动网络服务...
NET START TCPIP
NET START DHCP
NET START NLA
NET START LMHOSTS

NET START SERVER
NET START NETMAN
NET START TAPISRV
NET START RASMAN
NET START WZCSVC

DEL /Q %SystemRoot%\INF\*.PNF %SystemRoot%\INF\INFCACHE.1

Start PENETCFG.EXE