Sure. I don't know if all the changes are necessary, because i played a bit with some functions.
Change startnet.cmd
echo restart network...
x:\windows\system32\netcfg -winpe
wpeinit -unattend=x:\windows\system32\unattend.xml
@echo.
@echo.
echo wait 10 seconds...
@ping -n 10 -w 1000 127.0.0.1 > nul
ipconfig /renew
It's necessary to add the following line either to the startnet.cmd script or another script which is loading startnet.cmd
sc config mpssvc start= demand
net start mpssvc
Also you don't have to use "x:\windows\system32\wpeutil.exe Initializenetwork". It just fails in my scenario.
I'm using Win7PE_SE to build my recovery system. I'm attaching my documentary, it's in german, but maybe you can still use it.
https://www.dropbox....y_PE31.pdf?dl=0
tl;dr
@echo off
echo Initialize recovery environment...
start /wait X:\Windows\System32\startnet.cmd
echo wait 10 seconds...
@ping -n 10 -w 1000 127.0.0.1 > nul
start /wait X:\Windows\System32\vncpass.cmd
sc config mpssvc start= demand
net start mpssvc
RMDIR /S /Q X:\logs
del %windir%\System32\vncpass.cmd
del %windir%\System32\vnc.reg
del %windir%\System32\getnics.vbs
del %windir%\System32\wget.vbs
del %windir%\System32\unattend.xml
exit
@echo off
REM \windows\system32\startnet.cmd
echo Getting PCI IDs of Network adapters...
cscript /nologo getnics.vbs > nics.cmd
REM type nics.cmd
call nics.cmd > nul
REM example nics.cmd file contents shown below:
REM SET SHORT_NET1=PCI\VEN_8086&DEV_10C0
REM SET LONG_NET1=PCI\VEN_8086&DEV_10C0&SUBSYS_020D1028
REM SET LONGREV_NET1=PCI\VEN_8086&DEV_10C0&SUBSYS_020D1028&REV_02
REM SET SHORT_NET2=PCI\VEN_8086&DEV_10C0
REM SET LONG_NET2=PCI\VEN_8086&DEV_10C0&SUBSYS_020D1028
REM SET LONGREV_NET2=PCI\VEN_8086&DEV_10C0&SUBSYS_020D1028&REV_02
@echo Looking for \DRIVERS\DRIVERS.TAG file...
@for %%I in (C D E F G H I J K L M N O P Q R S T U V W X Y Z) do @if exist %%I:\DRIVERS\DRIVERS.TAG SET DRV=%%I
@if NOT "%DRV%"=="" (
@echo FOUND DRIVERS.TAG file in %DRV%, now loading drivers...
SET DRVA=
SET DRVB=
SET DRVC=
@for /D %%P in (%DRV%:\DRIVERS\*.*) do @for %%I in ("%%~fP\*.inf") do call :TESTINF %%~fI
)
@echo BEST MATCH=%DRVA%, NEXT MATCH=%DRVB%, LAST MATCH=%DRVC%
IF @%DRVA%%DRVB%%DRVC%==@ (
@Echo.
@ECHO **** WARNING: NO SUITABLE DRIVER FOUND - LOADING ALL DRIVERS! ****
@Echo.
@for /D %%P in (%DRV%:\DRIVERS\*.*) do @for %%I in ("%%~fP\*.inf") do drvload %%~fI
)
if NOT @%DRVA%==@ (
@ECHO LOADING %DRVA%...
DRVLOAD %DRVA%
if not errorlevel 1 (
SET DRVB=
SET DRVC=
)
)
if NOT @%DRVB%==@ (
@ECHO LOADING %DRVB%...
DRVLOAD %DRVB%
if not errorlevel 1 SET DRVC=
)
if NOT @%DRVC%==@ (
@ECHO LOADING %DRVC%...
DRVLOAD %DRVC%
)
echo restart network...
x:\windows\system32\netcfg -winpe
wpeinit -unattend=x:\windows\system32\unattend.xml
@echo.
@echo.
echo wait 10 seconds...
@ping -n 10 -w 1000 127.0.0.1 > nul
ipconfig /renew
GOTO :EXITPROGRAM
:TESTINF
SET FNAME=%1
IF NOT EXIST %FNAME% goto :EOF
SET LONGREV_NET=%LONGREV_NET1%
SET LONG_NET=%LONG_NET1%
SET SHORT_NET=%SHORT_NET1%
call :TESTINF1
SET LONGREV_NET=%LONGREV_NET2%
SET LONG_NET=%LONG_NET2%
SET SHORT_NET=%SHORT_NET2%
call :TESTINF1
SET LONGREV_NET=%LONGREV_NET3%
SET LONG_NET=%LONG_NET3%
SET SHORT_NET=%SHORT_NET3%
call :TESTINF1
goto :EOF
:TESTINF1
SET TI=%LONGREV_NET%
if NOT @%TI%==@ (
@Echo Checking for %TI% in %FNAME%
find /I %TI% %FNAME% > nul
if NOT errorlevel 1 SET DRVA=%FNAME%
if NOT errorlevel 1 echo ***** FOUND MATCH IN %FNAME% *****
if NOT errorlevel 1 goto :EOF
)
SET TI=%LONG_NET%
if NOT @%TI%==@ (
find /I %TI% %FNAME% > nul
if NOT errorlevel 1 SET DRVB=%FNAME%
if NOT errorlevel 1 echo ***** FOUND MATCH IN %FNAME% *****
if NOT errorlevel 1 goto :EOF
)
SET TI=%SHORT_NET%
if NOT @%TI%==@ (
find /I %TI% %FNAME% > nul
if NOT errorlevel 1 SET DRVC=%FNAME%
if NOT errorlevel 1 echo ***** FOUND MATCH IN %FNAME% *****
)
goto :EOF
:EXITPROGRAM
exit
Edited by karaktaka, 30 October 2014 - 11:03 AM.