Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 



Sign in to follow this  
siritalia

WINPE Script Help

Recommended Posts

siritalia    0

Hi all,

Just wondering if someone can help me or point me in the right direction. I have the below script which runs fine untill it hits the image_IT part then comes up unable to open file........exiting script in five seconds.

Then the rest of the script displays and the laptop reboots with no image been applied. All I need it to do is search the external HDD for the image file and apply it. I have also included a file i have created but not sure if it is required.

CLS

@ECHO OFF

set blankLine=-

ECHO Please select the image below...

ECHO 1 - HP 8440P

ECHO 2 - HP 8000

ECHO 3 - DELL D630

ECHO 4 - OTHER IMAGE

echo %blankLine%

SET /P selectOpt=Please select a option from above:

echo %blankLine%

IF %selectOpt% == 1 goto :opt1

IF %selectOpt% == 2 goto :opt2

IF %selectOpt% == 3 goto :opt3

IF %selectOpt% == 4 goto :opt4

exit

REM ---------------------------------

REM here for opt1

REM ---------------------------------

:opt1

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

image_it.exe

rem imagex /apply %location%:HP 8440P.wim 1 c:

type done.txt

exit

REM ---------------------------------

REM here for opt2

REM ---------------------------------

:opt2

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

image_it.exe

rem imagex /apply %location%:HP 8000.wim 1 c:

type done.txt

exit

REM ---------------------------------

REM here for opt3

REM ---------------------------------

:opt3

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

image_it.exe

rem imagex /apply %location%:DELL D630.wim 1 c:

type done.txt

exit

REM ---------------------------------

REM here for opt4

REM ---------------------------------

:opt4

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

image_it.exe

rem imagex /apply %location%:OTHER IMAGE.wim 1 c:

type done.txt

exit

Share this post


Link to post
Share on other sites

Tripredacus    283

Boot into your WinPE, and get to a CMD. Then try to run image_it.exe manually. I wouldn't be surprised if you either have an architecture mismatch or are missing a dependency.

Share this post


Link to post
Share on other sites
jaclaz    911

May I ask WHAT :w00t: is image_it.exe? :unsure:

Whatever it is, it is "strange" that is run in the same way (with no parameters) in each of the available options ....

jaclaz

Edited by jaclaz

Share this post


Link to post
Share on other sites
siritalia    0

Hi guys,

So i have changed the script now to not use IMAGE_IT. No more but how do I get it to choose the USB drive as at present I have to have the dvd in the drive to apply the image:

wpeinit

CLS

@ECHO OFF

set blankLine=-

ECHO Please select the image below...

ECHO 1 - HP 8440P

ECHO 2 - HP 8000

ECHO 3 - DELL D630

ECHO 4 - OTHER IMAGE

echo %blankLine%

SET /P selectOpt=Please select a option from above:

echo %blankLine%

IF %selectOpt% == 1 goto :opt1

IF %selectOpt% == 2 goto :opt2

IF %selectOpt% == 3 goto :opt3

IF %selectOpt% == 4 goto :opt4

exit

REM ---------------------------------

REM here for opt1

REM ---------------------------------

:opt1

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

imagex /apply d:\HP 8440P.wim 1 c:\

type done.txt

pause

exit

REM ---------------------------------

REM here for opt2

REM ---------------------------------

:opt2

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

imagex /apply d:\HP 8000.wim 1 c:\

type done.txt

pause

exit

REM ---------------------------------

REM here for opt3

REM ---------------------------------

:opt3

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

imagex /apply d:\DELL D630.wim 1 c:\

type done.txt

pause

exit

REM ---------------------------------

REM here for opt4

REM ---------------------------------

:opt4

wpeinit

@echo off

type clean_disk.txt

pause

diskpart /s clean.txt

rem type image.txt

imagex /apply d:\OTHER IMAGE.wim 1 c:\

type done.txt

pause

exit

Edited by siritalia

Share this post


Link to post
Share on other sites
Tripredacus    283

So you need to (beside start using code tags and get rid of that extra space) is to find where the image is kept. You can do it with WMI, but many people cheap out and just search all drive letters for a matching path. Example:

cmd /c 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:\wpi\wpi.exe start %i:\wpi\wpi.exe

source:

But I do not know if you can read from WMI directly with a .cmd in WinPE (does wmic work?) without using a scripting or programming language.

Share this post


Link to post
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

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×