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  
zbarre

Script startup BartPE

Recommended Posts

Here's something I've been tearing my hair out over the last couple of days: Trying to get BartPE to eject the CD, pause, then reboot the PC. I have gotten this to somewhat work with peshuteject.exe, and was hoping for some help. To start with, I have a "reboot.cmd" file I created that will change directories to the RAM drive, release the IP, then reboot. Since peshuteject, I've modified it to read (B: is the RAMDRIVE):

=========================

b:

ipconfig /release

@echo off

copy %SystemDrive%\Programs\Reboot\peshuteject.exe b:\

b:\peshuteject.exe /eject:%systemdrive%

cls

@echo.

@echo.

@echo. Please remove BartPE from the drive and press SPACE to reboot

@echo.

@echo.

pause

b:\peshuteject.exe /reboot

=========================

I have the reboot.cmd file set to copy to the RAMDRIVE on bootup, and put the %ramdrv% in the PATH statement of pebuilder.inf so the reboot.cmd can be run from anywhere. When it fails, it hangs immediately after ejecting the CD. I can do the "peshuteject.exe /eject:%systemdrive% /reboot", but that doesn't give the tech enough time to remove the CD before the PC reboots and yanks it back in.

Help!

Share this post


Link to post
Share on other sites

Sorry for digging up such an old thread, but its the best info Ive found...

My source disk doesnt contain choice.exe - how can I specify the custom.inf file to look in another location for it?

Or

Can I simply build an ISO image and then use an ISO image editor to add choice.exe to the i386\system32 directory later? (I have tried this, however when choice.exe is executed it appears to lock up, nothing happens. I havent tried copying choice.exe to the folder that contains the batch file, but from testing on my own (XP Build) machine I have found it wont work unless the file is called from the system32 directory - edit: also i have tried running choice.exe from the bart cd's system32 directory however it doesnt work)..

Any ideas? Thanks :)

Edited by Method101

Share this post


Link to post
Share on other sites

Ive been playing around with this choice.exe problem.

Choice.exe works when stored in the same directory as the batch file. The batch file executable commands had to contain the full path to choice.exe as I created a menu item in nu2menu.xml. So all my problems are solved. Sweet.

Edited by Method101

Share this post


Link to post
Share on other sites

hello this thead has really helped me a lot. 2 days ago I was using dos/ghost8.exe now i'm using bartpe/ghost32 and able to use batch file with to automate the whole restore process.

Here is issue i'm having right now and it's probably simple but can't get it to work.

I would like to create a menu.bat that will launch and give users choice of which image to restore, I just need a simple batch file to this with echo commands. I ahve the batch file in that ini file, but when I bartpe finish mapping network drives, etc. I see the batch file appear and disappear real quick, so i'm not albe to see the menu, can anyone let me know what command to use, so the dos box does not disappear?

here is code i have

cls

@ECHO off

PROMPT

T:

cd T:\images\scripts

ECHO Enter appropriate PC type to image:

ECHO D530SP - SYSPREP for D530

ECHO ghost600 - SYSPREP for VL600

ECHO ghost600 - SYSPREP for VL400

ECHO 600 - VL600 std build

ECHO 400 - VL400 std build

ECHO farm600 - VL600 Farm Build

ECHO farm600 - VL400 Farm Build

Thanks for all your help, nuff respect.

Share this post


Link to post
Share on other sites

All your script does is echo some text, that's why it closes quickly.

:_start
ECHO A D530
ECHO B VL600
SET /P Choice=Please select:
IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%
ECHO.
IF /I '%Choice%'=='A' GOTO _labelA
IF /I '%Choice%'=='B' GOTO _labelB
ECHO "%Choice%" is not valid.
ECHO.
GOTO _start

:_labelA
ghost32.exe ...

Share this post


Link to post
Share on other sites

Thanks a lot I'll give that a try. I ended up creating 2 batch files, menu and menu1,

menu is in the ini file in pebuilder and it calls menu1

menu1 Starts the winpe command prompt, I set it to 0 = start "cmd.exe" /wait and then it calls the menu1, which has the menu stuff I wrote above, this seems to work great, if I have to redo the menu, I dont have to rebuild bart pe, I just edit the menu1 on the server where I store the images.

Thanks for all your help.

Is there a list of necessary things that loads with bart PE, i'm trying to make the initial startup of bart pe, go a bit faster, if I take out certain apps will it load faster, I would really like to just have the start button and ghost application and the shutdown/restart command and thats it.

Thanks again.

Share this post


Link to post
Share on other sites

Have to say thanks for this thread is been really great in getting me to where i wanted to be!!!!

Ive done a bit of work on the scripting of ghost for different images so i thought id share! heres whats in my menu.bat file......

youll need to change the menu option names

then the GOTO headings (HP8100ma)

The path to your ghost32.exe (mines ghost11)

and the path to your image (src=G:\DELL745\745F.GHO) (G: is my mapped drive that has the ghost images)

---------------------------------------------------------------------------------------

@echo off

CLS

echo Main Menu:

echo Please select the system and Image to Ghost.

:loop

echo A HP 8100 - Main image

echo B HP 8100 - Summation

echo C HP 7800 - Main Image

echo D Dell 745 - Main Image

echo Q Quit

SET /P Choice=Type the letter and press Enter:

:: The syntax in the next line extracts the substring

:: starting at 0 (the beginning) and 1 character long

IF NOT '%Choice%'=='' SET Choice=%Choice:~0,1%

IF /I '%Choice%'=='A' GOTO HP8100ma

IF /I '%Choice%'=='B' GOTO HP8100SU

IF /I '%Choice%'=='C' GOTO HP7800MA

IF /I '%Choice%'=='D' GOTO Dell745M

IF /I '%Choice%'=='Q' GOTO End

ECHO "%Choice%" is not valid. Please try again.

ECHO.

GOTO Loop

:: =================================

:HP8100ma

X:\Programs\ghost11\ghost32.exe -clone,mode=prestore,src=G:\HP810\810F.GHO:1,dst=1:1 -sure

GOTO end

:: =================================

:HP8100SU

X:\Programs\ghost11\ghost32.exe -clone,mode=prestore,src=G:\HP810\810S.GHO:1,dst=1:1 -sure

GOTO end

:: =================================

:HP7800MA

X:\Programs\ghost11\ghost32.exe -clone,mode=prestore,src=G:\HP780\780F.GHO:1,dst=1:1 -sure

GOTO end

:: =================================

:Dell745M

X:\Programs\ghost11\ghost32.exe -clone,mode=prestore,src=G:\DELL745\745F.GHO:1,dst=1:1 -sure

GOTO end

:: =================================

:end

pause

-----------------------------------------------------------------------------------------------

Hope this helps :-)

any questions just ask!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...