Jump to content

Welcome to MSFN Forum
Register now to gain access to all of our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more. This message will be removed once you have signed in.
Login to Account Create an Account



Photo

WINPE Script Help

- - - - -

  • Please log in to reply
4 replies to this topic

#1
siritalia

siritalia
  • Member
  • 2 posts
  • Joined 07-August 12
  • OS:none specified
  • Country: Country Flag
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







How to remove advertisement from MSFN

#2
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,923 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg

#3
jaclaz

jaclaz

    The Finder

  • Developer
  • 14,593 posts
  • Joined 23-July 04
  • OS:none specified
  • Country: Country Flag
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, 07 August 2012 - 08:43 AM.


#4
siritalia

siritalia
  • Member
  • 2 posts
  • Joined 07-August 12
  • OS:none specified
  • Country: Country Flag
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, 07 August 2012 - 06:50 PM.


#5
Tripredacus

Tripredacus

    K-Mart-ian Legend

  • Super Moderator
  • 9,923 posts
  • Joined 28-April 06
  • OS:Server 2012
  • Country: Country Flag

Donator

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: http://www.msfn.org/...post__p__973912

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.
MSFN RULES | GimageX HTA for PE 3-5 | lol probloms
msfn2_zpsc37c7153.jpg




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users