Jump to content

WinPE 2.0 and findstr


pankajtakawale

Recommended Posts

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!

Link to comment
Share on other sites


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.

Link to comment
Share on other sites

why not just call a script to ping your DHCP server.....

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

This will just loop until you get an address.

Link to comment
Share on other sites

  • 4 weeks later...
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...