Jump to content

Win PE and Ghost32


Recommended Posts

Hi Folks,

I am a newbie in this forum of discusion about WinPE. I have a question about WinPE and Ghost32.

How do I write and add .bat script into the WinPE boot disk so that when WinPE boot up it will automatically get to a file server that has ghost image and run ghost32 to get the image to the machine that boot with WinPE without asking any input from user?

Here is the situation:

File server \\ImageServer\Ghost (ghost32.exe and ghost images are under this folder)

User: xxxxx, password: xxxxx


Link to comment
Share on other sites

This is a little more complicated then it looks. The general procedure would look something like:

1. First, enable networking in WinPE

2. EDIT the startnet.cmd to include maping a drive letter to the server share

3. Adding another line that would use the above drive and run ghost32

In what mode are you running WinPE right now? (i.e, what is the first line of your startnet.cmd?)

Edited by JuMz
Link to comment
Share on other sites

you have to add in the startnet.cmd the following line to map a network drive.

net use z: \\server\share "password_of_share" /user:server\user(i.e administrator)

Link to comment
Share on other sites

You don't need a drive letter to use Ghost32, just for your information.

set GhostPath=\\ImageServer\Ghost
Net use %GhostPath% /user:xxxxx "password"
Start /wait "%ghostpath%"\Ghost32.exe

I use a huge pile of scripting to detect the local subnet, assign a "parent server", detect the hardware of the machine I'm on, drop the appropriate ghost image automatically, drop additional files if needed, eject the CD and reboot. It all just depends on your creativity :)

Link to comment
Share on other sites

Thanks for your help. Here is a situation: I have different kind of Dell workstations, how do I create scripts that will able to determine the type of machine it boot from (ex. Dell620) then select the type of images then eject the CD after finished getting the image...What command that will allow the system eject the CD and reboot after it finished getting the image? Thanks.

Link to comment
Share on other sites

I do a lot of that sort of scripting here. Easiest answer is to build a "sysprep" image that you always ghost down, and then if you need HAL changes, put in a script to detect your hardware and drop the appropriate NTOSKRNL and HAL files onto the drive before rebooting into the minisetup.

The things you're asking for (detecting hardware, ejecting CD) are not built into PE by default. You will need to create a PE image with WMI support enabled from the MKIMG.CMD command line argument. You also need to add in WSH support through BUILDOPTIONALCOMPONENTS.VBS from your PE ODK files.

Once you have WMI and WSH functionality in your PE image, you can build a very simple WMI query to enumerate what kind of PC you're on. I'm not going to give away all my secrets, but I'll help you by giving you the contents of a very basic VBS file to query the proper WMI component:

set oSvc = GetObject("winmgmts:root\cimv2")
wqlQuery = "select Version from Win32_ComputerSystemProduct"

for each oTEMP in oSvc.ExecQuery(wqlQuery)

wscript.echo oTemp.GetObjectText_

Copy-n-paste that into a blank Notepad doc, give it a VBS extension and double-click it from your normal OS that you're on right now. You'll notice the "Version" field will be the hardware model of your PC. You can now tweak that VBS file to branch out based on individual cases...

As for your Eject request? I use a simple tool called EJECT.EXE; a freeware utility that allows you to simply specify "eject.exe <driveletter>" to eject a CD rom tray. I combine it with another VBS that enumerates mounted volumes to see which (if any) CD tray my CD is in and then eject it if found (I use a standardized naming convention for all my bootable PE CD's that lends itself to easily being found)

Keep in mind that you can't eject the CD from within PE unless you're operating in a ramdisk environment (with the /INRAM option, or ramdisk-from-iso option, or ramdisk-from-sdi option).

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