Jump to content

Script startup BartPE


zbarre

Recommended Posts

The first two commands you recomended works fine. After finished getting image, ghost exited, system ejected CD but would not reboot. The problem here is that the bat file contains these commands is on the mapped drive, when CD is ejected it would not execute shutdown command. Is there any way we put this shutdown command somewhere else to make it execute? Is it posible to put in in RAM disk?

If you modify the Custom plug-in in PEBuilder, as shown below, then the Shutdown.exe command will be automatically included in the BartPE System32 directory which is in the PATH environment variable so your .BAT file will find it correctly. Or you can just copy Shutdown.exe from an existing XP/2003 system to the network share directory where you run the .BAT file from. Either method should work. Also take a look at DJe's post #28 in this same thread.

Step 1) Edit the Custom.inf file in the pebuilder3110a\plugin\!custom directory adding the following section and line to the end of the file:

[SourceDisksFiles]
shutdown.exe=2

Thanks for testing this out, I was sure you could make these techniques work. I feel we have advanced unattended installs up another notch (maybe to the insane level) with these steps... Great work guys! :thumbup

I edited my post above: It works! (peshuteject.exe, of course)

GREAT JOB! Big thanks for finding the PE Shut & Eject Utility! I will have to play with this some day. (though it's hard to find the time to make shiny round coasters when you've set up PXE/RIS... :P ) You never know when this technique will come in handy!

Anyone buying me beer & pizza for this help? :blushing: Just kidding...

Link to comment
Share on other sites


Do I have to put those into PEbuilder as a plugin or just put the execute file in the mapped drive and the command in the bat file? Thanks.

using peshuteject.exe can only eject CD but not reboot the system. Is /shut is the right switch?

Link to comment
Share on other sites

Do I have to put those into PEbuilder as a plugin or just put the execute file in the mapped drive and the command in the bat file? Thanks.

You can do either or both let me say this another way... If you modify the Custom.inf and rebuild your BartPE CD then Shutdown.exe will be available via the System32 directory OR you can copy the Shutdown.exe file to the directory you have the .BAT file in OR you can do both! It won't hurt if Shutdown.exe is in both places (but it's probably cleaner to add it through PEBuilder via Custom.inf) but maybe much faster to test with by just copying it to the network directory the .BAT file is in.

Either method will work and should get you the same result a workings SHUTDOWN -R -F command line utility! :D

Link to comment
Share on other sites

I tried your method but it doesn't work.

Can you be more descriptive, what exactly didn't work? Can you post the part of your .BAT file that didn't work?

Remember when running .EXE's from the network share you must specify the full path to them like so:

Z:\SHUTDOWN.EXE -R -F (where Z: is mapped to the directory the .BAT file is in)

TIP: The other alternative is to modify the PATH variable like so: SET PATH=%PATH%;Z:\ (I haven't tried this yet in BartPE I don't know for sure if BartPE supports the SET command) This method would allow you to run the SHUTDOWN command without specifiying the full path to it.

Edited by indy_dba
Link to comment
Share on other sites

Here is the bat file:

z:\ghost32.exe -fx -sure

z:\eject.exe

z:\shutdown.exe -r -f

Where Z is the mapped drive. As I looked into the directory I saw that X:\i386\system32 I noticed that shutdown.exe is in here. However, X drive is the CD drive, if the system eject the CD drive then the shutdown.exe won't execute. Even when I copied shutdown.exe to RAM drive which is B in this case, shutdown.exe still could not execute. I tried peshuteject.exe, the same result. System ejected CD but won't reboot. Any ideas? Thanks.

Link to comment
Share on other sites

using peshuteject.exe can only eject CD but not reboot the system. Is /shut is the right switch?

Here it DOES eject AND reboot using those switches:

peshuteject.exe /eject /reboot

if you specify the drive to eject it is even cleaner (otherwise it tries all drives down to z:):

peshuteject.exe /eject:x /reboot

Maybe allow it for a few seconds but most important, run it from somewhere else than the CD drive.

Link to comment
Share on other sites

It WORKS!!! Thanks a lot, guys. peshuteject.exe /eject:x /reboot works GREAT. Thanks again.

Good work again guys! I am so used to my BartPE being in RAM drive from the PXE boot that I forget when running from CD-ROM you need to run commands from it so it's like duhhhhhh on why Shutdown wouldn't work from the CD... I am a little :blushing: about not remembering this...

I like the syntax of peshuteject.exe better anyway. Very cool stuff! B)

Link to comment
Share on other sites

[sourceDisksFiles]

choice.exe=2

shutdown.exe=2

Do the choice and shutdown files have to be added to BartPE somehow, or are they called up on a remote share? Also, what is the reason for "=2" ?

If you want these files available for use in a .BAT or .CMD script then you need to tell PEBuilder to include them when you make a BartPE build. The =2 tells PEBuilder to put them in the System32 directory if I remember correctly. See the "directories ID table" in the online help for BartPE at http://www.nu2.nu/pebuilder/help/english/p...inntDirectories

Edited by indy_dba
Link to comment
Share on other sites

thanks for the link^

What I mean to ask is; Will pebuilder know where to grab these files or is there a directory that they must be in (that pebuilder looks in by default?)

--- well, i guess they would be on the source disk, and that is needed everytime you "Build" with pebuilder. so maybe that's the answer.---

Edited by peliROJO
Link to comment
Share on other sites

thanks for the link^

What I mean to ask is; Will pebuilder know where to grab these files or is there a directory that they must be in (that pebuilder looks in by default?)

--- well, i guess they would be on the source disk, and that is needed everytime you "Build" with pebuilder. so maybe that's the answer.---

Correct these files come from the I386 directory from the source disk/directory and PEBuilder grabs them from there.

Link to comment
Share on other sites

I just found why in some situations I couln't get peshuteject to work properly (it could eject but not reboot):

In those situations I was launching it by dble-clicking a .cmd file in the A43 file browser.

But if I just call the .cmd file from a CMD window, it works ok.

So it seems that to have peshuteject running properly, A43 should be closed. This may also be necesary with some other progs, beware.

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...