Help - Search - Members - Calendar
Full Version: WinPE 2.0 and findstr
MSFN Forums > Unattended Windows Discussion & Support > Windows PE

   
Google Internet Forums Unattended CD/DVD Guide
pankajtakawale
what is alternative to findstr in WinPE 2.0. findstr is unrecognized in WinPE.
Once WinPE starts I want to wait untill ipaddress is being assigned to WinPE box.
Following is the script I found on the net:

rem if not defined Debug echo off

set i=0
:Loop
ipconfig.exe /all | findstr "Lease Obtained" > NUL & goto :Found
set /A i=%i%+1
echo DHCP address not found. Wait for 10 seconds and try again. [%i%/6]
sleep 10
if not "%i%"=="6" goto :Loop

:NotFound
@echo The DHCP address was not acquired.
@echo Please ensure that you have a netcard with a valid driver.
netcfg -v -s a
pause
goto :EOF

:Found
@echo Found!
zorphnog
wpeinit initializes all of your ip settings. If you just wait until it finishes then you will have an IP address. Alternatively, you could just add findstr and sleep to the system32 folder of your PE image.
p4ntb0y
why not just call a script to ping your DHCP server.....

QUOTE

rem @echo off
REM
REM This is the first Script called from Startnet.cmd stub in the WinPE
REM

REM Make sure that the network is fully started... Sometimes it requires a bit of time
:REPEAT1
ipconfig
ipconfig
ipconfig
ipconfig
ping 10.7.86.15
if errorlevel 1 GOTO REPEAT1
rem @echo off
REM
QUOTE


This will just loop until you get an address.
sn3ak
QUOTE (pankajtakawale @ Jun 5 2007, 05:51 AM) *
what is alternative to findstr in WinPE 2.0. findstr is unrecognized in WinPE.
Once WinPE starts I want to wait untill ipaddress is being assigned to WinPE box.
Following is the script I found on the net:



Assuming you have a vista install already, mount the winpe wim, and copy findstr.exe from your vista install to the system32 directory in the wim.
iirc findstr lives in \windows\system32.
os2fan2
findstr needs a NLS setting in registry. This may not exist in the default WinPE.

If you plan to use WinPE as a rescue environment, then you need to set NLS settings. This is for things like compare files, etc, as well as sorting etc.
Google Internet Forums Unattended CD/DVD Guide
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.