Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Creating and Using a WinPE3.1 image with GSS 2.5.1

Created: 13 Aug 2013 • Updated: 13 Aug 2013 | 70 comments
Language Translations
Terry BU's picture
+4 4 Votes
Login to vote

In this article, I am going to write down the steps that I took to create a WinPE 3.1 boot image that can be used to contact the GSS console.  This is by no means required, and, in all honesty, doesn't work correctly 100% of the time.  I will give examples later.

Here is a great resource that talks about the WAIK, using it to create an image, and has the links for getting it: Adventures with WinPE 3.1

Thanks EdT!  He also touches on the idea of scripting out a lot of the process, which I do as well.

The first thing you need to do is get the Microsoft WAIK, and install it.  You can use a VM for this, or your regular machine, it's up to you.

When we go to build the PE, we will be using the 32bit PE since the ability to ping the console is built into a 32bit app.

Second, on the server that is running your Ghost Solution Suite console, open the Ghost Boot Wizard.  Select WinPE, click edit.  Highlight the WinPE 2.0 boot partition you are using that has all of your drivers.  Make sure you highlight this one, and not a stock one.  Click copy, and give it a nice short name (like WinPE3).  Make note of where it is storing the files (ProgramData\Symantec\Ghost\Template\COMMON).  Your newly made PE will be in that folder under its own folder with the name you gave it.  Remember this.

Third, make yourself a new WinPE 3.0 PE on your PE'ing machine!  Open the "Deployment Tools Command Prompt" as an admin from the machine you installed the WAIK.  DON'T CLOSE THIS PROMPT.  NOT UNTIL THE VERY END.  Think of a nice folder name for your PE so you remember where it is!  (this guide will use "C:\winpe" as the location)  Next, come up with a holding directory for files and folders before you copy them over (maybe c:\bootcd\makepe).  Now, create your PE with the following commands

  1. copype x86 c:\winpe
  2. copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim

Awesome, you now have the PE made, and it is time to mount that WIM file with the following command

  1. dism /mount-wim /wimfile:c:\winpe\winpe.wim /index:1 /mountdir:c:\winpe\mount

Now, this allows you to mess with the WIM file as a directory instead of a file.  It is located at c:\winpe\mount.  This is the section of the fun where we add all of the utilities, files, custom backgrounds, drivers, etc.  I will give some examples, as well as the commands for adding drivers, since that is important

I HIGHLY recommend you do the following at this point (some of these really are required for this to work as a Ghost PE, but not all of it)

  1. Add IMAGEX or GIMAGEX to your holding folder (its a nice graphical front end for IMAGEX) and also copy it to the "c:\winpe\mount\windows\system32" directory.  Necessary?  No, but its a useful tool for the future.
  2. Make a folder called "Scripts" under your holding folder earlier.  We will come back to this later!
  3. Open a console boot partition that you have made some time before inside Ghost Explorer and steal all of the stuff in the Ghost directory.  Put that all in a directory in your holding folder called "Ghost".  You want the following things in this folder: copy.bat (from the console partition), GDISK32, GhConfig32, Ghost32, Ghostoem32, ghreboot.bat (from the console partition), GhRegEdit32, ghvp.bat (from the console partition), NGCTW32 (this is the biggest piece, you NEED this.  Get it from the console partition if necessary), your pubkey.crt, and the file VPartition.dll (from the console partition).  Copy that directory over to "c:\winpe\mount\Ghost".  This whole step is MANDATORY for this to contact the server.  I am sure there will be questions on this step.  Ask below.
  4. Make a file named STARTNET.CMD in your holding folder.  This is super important.  I will come back to it as its own numbered list in a minute.
  5. Want a custom background?  Name it "winpe.bmp", put it in your holding folder, and also put it in the "c:\winpe\mount\windows\system32" folder
  6. Go get the program "GETMAC" from an old XP install.  You know you have one.  Put it in the holding folder and the mount\windows\system32 folder just as above.  This is not required, but it is really nice to be able to pull the MAC address without all the other ipconfig stuff.

You will see me using this holding folder a lot.  It is nice because if you mess up, you have duplicates and can just move them over!  Also allows for great scripting!

Now, back to that command prompt.  run the following commands:

  1. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"
  2. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-Scripting.cab"
  3. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-WMI.cab"

Doing those adds abilities to your PE to run HTML stuff, scripts, and return WMI info.  There are more, but those 3 are really good.

Now, I recommend you go get Network drivers for your network cards (Win7 has a lot of them, but you will probably still need some.), maybe even a chipset driver too.  Put all the folders inside a folder somewhere.  For the network drivers, you only need the NDIS62 drivers, and all drivers you are going to include MUST BE 32bit Win7 drivers!  for sake of argument, lets say you stored them in a folder called "c:\bootcd\makepe\winpedrivers32".  Now from the command prompt you have open, run the following command

  1. dism /image:c:\winpe\mount /add-driver /driver:c:\bootcd\makepe\winpedrivers32 /recurse

That will put all of your drivers in your PE image.  It does take a minute.

Now, we are going to go back to some of the folders and files from earlier, and make some new ones too!!  Note the PE isnt "committed" yet.

Now we start in on the scripts.  This is important.  They help so much.  Make each of these as its own CMD file in that "Scripts" folder you made in the holding area.

First, make a script called "setPath.cmd".  It has one line in it.  This sets up your PATH variable so you can just call your scripts

  1. set path=%path%;x:\Program Files;x:\ghost;x:\scripts;

Second, make a script called "reboot.cmd".  It has one line in it.  This allows you to type "reboot" at the prompt and the computer will restart

  1. wpeutil reboot

Third, the most important script.  This is flat out taken from a boot partition and makes the comp phone home to the console.  call it "startGhost.cmd".  It has the following (yes line 3 is blank)

  1. rem --- This will remove any traces of virtual partition from hard drive ---
  2. x:\ghost\gdisk32.exe /revert  >> x:\ghost\startlog.txt
  3.  
  4. rem --- This will create primary OS drive configuration ---
  5. x:\ghost\ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt
  6. start x:\ghost\ngctw32.exe -console

NGCTW32.exe -console is what opens the window that sends and acknowledges your GSS server.  Super important

Add some more scripts if you want.  i have ones that reinitialize the WINPE networking, start backup sessions, even use VNC inside the PE!  (i can talk about that later if people want)

Now, copy the SCRIPTS folder over into the c:\winpe\mount directory.

Next, we turn our attention to the STARTNET.CMD file we made.  Edit it, and add in the following

  1. wpeinit
  2. wpeutil disablefirewall
  3. start /min cmd.exe
  4. cmd /c x:\scripts\startGhost.cmd
  5. x:\scripts\setpath.cmd

This file is what gets everything going.  First we initialize the PE, then we shut off the firewall to help kill some issues.  We open ANOTHER cmd prompt for later use (it will be minimized by default).  We then start up the ghost phone home.  We then set our PATH as before so we can call other scripts if we want to (from this window, the other one wont have the path set, but system32 is in the path by default, so GETMAC works from that window, so does IPCONFIG, etc)

Copy the STARTNET.CMD file from your holding directory to c:\winpe\mount\system32.  Yes you want to replace it with your new, more awesome one.

Now its time to commit.  Settle down, start a WinPE3.0 session.  Run the following:

  1. dism /unmount-wim /mountdir:c:\winpe\mount /commit

That seals in your changes.  Next, we replace the WIM with the new one you just lovingly hand made.  run this:

  1. copy c:\winpe\winpe.wim c:\winpe\ISO\sources\boot.wim /y

Make an ISO of it!  You need to know where you are saving it.  How about c:\ISOs?  Run this:

  1. oscdimg -n -bc:\winpe\etfsboot.com c:\winpe\ISO c:\ISOs\winpe3.iso

See how there is no space after the "-b", it just slams right into the "c:\" part.  That is on purpose.  There is no space there.  Don't do it.

 

PEing is hard work!  Now toss it in your CD burner oven and let it bake you a lovely CD.  Don't have time?  Need to use the USB microwave?  Sure!  mount that ISO in the utility of your choice.  Take a thumb drive (when I build the above, it fits on a 512MB drive [where can you even find them that small anymore?!])

Go into DISKPART, and select the USB drive. Run the following commands after that select command you just did to pick the USB drive and not your HD.  Super important you pick the right one, since were going to nuke it (microwave joke!)

  1. clean
  2. create partition primary
  3. select partition 1
  4. active
  5. format fs=NTFS quick

Now, to give an example, we will assume your ISO drive is E:\, and your thumb drive is L:\.  Change this to make it match yours.  You don't want to overwrite the wrong drive, or copy the wrong files

  1. xcopy E:\*.* /s/e/f L:\

That copies the ISO onto the thumbdrive.

If done correctly, you can now actually boot a comp from the CD or thumb drive.  When it starts pinging your GSS server "sending...acknowledged" you can pull it out and it will keep doing it!

Remember earlier when I said remember where GSS kept that WinPE3 folder under COMMON?  Open your folder, open "Sources" and replace the boot.wim in there with the one from the CD/USB key.  Confirm the move!  Now, you can NEVER EVER AGAIN open that PE in the Ghost Boot Wizard.  It will give you lots of errors.  But it does work.

If you go into the GSS console, you can now assign this as the Virtual Partition under the client tab.

The reason I had you take the working partition you normally use as the starting point and copying it is that the MANIFEST files are still used by GSS, and it still checks the manifest for drivers it assumes will be there.

So, since nothing is perfect, I'm sure you want to know what I know is broken (since I mentioned it earlier).  I have a weird situation where, from Windows, i can issue a Clone command, or a Config command, but not both together.  The config will fail after the clone succeeds.  But I can do the clone, let it succeed, then do the config.  Extra weird is that if I boot to that CD/USB key and issue the clone and config together, it works!  But only if the machine was already in the PE.

Please leave questions or feedback.  This is still a work in progress, it is a nice way to make a new boot CD.  It's also faster than taking a CD and ghosting the partition onto it.

Comments 70 CommentsJump to latest comment

Nick777's picture

I've done a similar process, and although I can sysprep, my configuration tasks fail, even simple ones like changing the computer name. My build is more pared down than yours, although all the ghost files you include are included in mine.

Do you have a sense as to what the extra modules for PE that you include help with? I'm thinking specifically of the three modules you include, 

  1. WinPE-HTA.cab
  2. WinPE-Scripting.cab
  3. WinPE-WMI.cab

 

I'm also wondering about the extra steps you take here in startnet.cmd:

  1. wpeinit
  2. wpeutil disablefirewall
  3. start /min cmd.exe
  4. cmd /c x:\scripts\startGhost.cmd
  5. x:\scripts\setpath.cmd

My startnet.cmd is simply winpeinit and startGhost.cmd. My startGhost.cmd contains the same commands yours does.

 

Why do you invoke a second command prompt? I do understand why you want to set a path variable, considering how many other 'goodies' you have hidden in there, but I think if the purpose is -purely- to replicate the GSS client task session, I don't think I should need it, should I?

0
Login to vote
Terry BU's picture

HTA is HTML functions, Scripting allows scripting to happen, and WMI allows WMI calls

 

the startnet i run does some extra stuff.  It turns off the firewall just to cut down on that being an issue.  step 3 opens a new command prompt that minimizes so you can run other utilities (ipconfig, getmac, etc) from a different window.  startghost opens a new prompt to start phoning home to the console, and finally, setpath sets my scripts folder to be in the default path (i probably could do that with a path call inside the startnet file) so i can run scripts when it is up and ready

 

in the end, no you dont NEED it.  It just adds the ability to have another open prompt waiting for you!

0
Login to vote
mehdim's picture

@ EdT

I am confused on this step 3 which

-- Open a console boot partition that you have made some time before inside Ghost Explorer

If I open Ghost explorer on ghost solutions machine there is no "Ghost Directory"  Is this installation folder for ghost solution please?

0
Login to vote
Terry BU's picture

that question was probably for me.

In step 3, (and sorry if it was a little unclear) i want you to take a working GSS console boot partition that you have made in the past.  Open that .GHO file inside Ghost Explorer.  Inside, you will see a "Ghost" directory that has the files i am talking about.  Copy those files out of the .GHO file to your WIM (or some other holding location)

0
Login to vote
mehdim's picture

@Edt

I have copied all the files under Ghost Server "C:\Program Files\Symantec\Ghost" into C:\winpe\mount\Ghost as mentioned in above for step3

I can not see the files like "Copy.bat" or rest of them says (from the console partition) in step3

I think I am looking to wron place.  where is this console partion?

0
Login to vote
mehdim's picture

@ Terry BU

thanks Terry

Please explain "holding folder" Does it mean creat folder with anyname under "C:\winpe\ and copy "GIMAGEX" and create "script" folder

0
Login to vote
Terry BU's picture

when i mention a "holding folder" i am really just talking about a place to store all the stuff you are using.  you dont want to just put it in the WinPE image since if you ever have to recreate it or update it, you want to be able to go back to your holding folder and be able to copy all that stuff again without having to dig for it

0
Login to vote
muhammadm's picture

Thanks Terry

Question on "Open a console boot partition that you have made some time before inside"

Is this partion on Ghost Server or client machine

What I have done is..

I have created Ghost folder under holding folder "C:\bootcd\makepe\ghost\" and copy most of the required files from pre-maid image using ghost explorer.

Than also made a copy of "Ghost folder" located "C:\bootcd\makepe\ghost\" into "C:\winpe\mount'

Please correct me if I am doing it wrong

0
Login to vote
Terry BU's picture

if you have ever made a console parition file, you can use that.  it will be on your ghost server, but also on any bootable media you have made to put a console partition on a machine

0
Login to vote
muhammadm's picture

@ Terry BU

"PE'ing machine"..

Is this Ghost server machine? or

the machine I have installed WAIK and looking to make image of it

0
Login to vote
muhammadm's picture

@ Terry BU

holding directory for files and folders

Is this on

Ghost server machine? or

the machine I have installed WAIK and looking to make image of it

0
Login to vote
Terry BU's picture

you can put the holding directory anywhere.  its just a backup for YOU should you ever have to remake/rebuild/update your PE

0
Login to vote
muhammadm's picture

@ Terry BU

I am getting an error when run

 

dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"

 

2013-12-16 16:25:15, Info DISM PID=7240 Scratch directory set to 'C:\Users\ZZ-M~1\AppData\Local\Temp\'. - CDISMManager::put_ScratchDir
2013-12-16 16:25:15, Info DISM PID=7240 Successfully loaded the ImageSession at "C:\Program Files\Windows AIK\Tools\AMD64\Servicing" - CDISMManager::LoadImageSession
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Found and Initialized the DISM Logger. - CDISMProviderStore::Internal_InitializeLogger
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Failed to get and initialize the PE Provider. Continuing by assuming that it is not a WinPE image. - CDISMProviderStore::Final_OnConnect
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Finished initializing the Provider Map. - CDISMProviderStore::Final_OnConnect
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has previously been initialized. Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has previously been initialized. Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Manager: PID=7240 Successfully created the local image session and provider store. - CDISMManager::CreateLocalImageSession
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Getting Provider DISMLogger - CDISMProviderStore::GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has previously been initialized. Returning the existing instance. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM.EXE:
2013-12-16 16:25:15, Info DISM DISM.EXE: <----- Starting Dism.exe session ----->
2013-12-16 16:25:15, Info DISM DISM.EXE:
2013-12-16 16:25:15, Info DISM DISM.EXE: Host machine information: OS Version=6.1.7601, Running architecture=amd64, Number of processors=4
2013-12-16 16:25:15, Info DISM DISM.EXE: Executing command line: dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Getting the collection of providers from a local provider store type. - CDISMProviderStore::GetProviderCollection
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Loading Provider from location C:\Program Files\Windows AIK\Tools\AMD64\Servicing\WimProvider.dll - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Connecting to the provider located at C:\Program Files\Windows AIK\Tools\AMD64\Servicing\WimProvider.dll. - CDISMProviderStore::Internal_LoadProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Loading Provider from location C:\Program Files\Windows AIK\Tools\AMD64\Servicing\FolderProvider.dll - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Connecting to the provider located at C:\Program Files\Windows AIK\Tools\AMD64\Servicing\FolderProvider.dll. - CDISMProviderStore::Internal_LoadProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Provider has not previously been encountered. Attempting to initialize the provider. - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Loading Provider from location C:\Program Files\Windows AIK\Tools\AMD64\Servicing\CompatProvider.dll - CDISMProviderStore::Internal_GetProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Connecting to the provider located at C:\Program Files\Windows AIK\Tools\AMD64\Servicing\CompatProvider.dll. - CDISMProviderStore::Internal_LoadProvider
2013-12-16 16:25:15, Info DISM DISM.EXE: Got the collection of providers. Now enumerating them to build the command table.
2013-12-16 16:25:15, Info DISM DISM.EXE: Attempting to add the commands from provider: WimManager
2013-12-16 16:25:15, Info DISM DISM.EXE: Succesfully registered commands for the provider: WimManager.
2013-12-16 16:25:15, Info DISM DISM.EXE: Attempting to add the commands from provider: FolderManager
2013-12-16 16:25:15, Info DISM DISM.EXE: Attempting to add the commands from provider: DISM Log Provider
2013-12-16 16:25:15, Info DISM DISM.EXE: Attempting to add the commands from provider: Compatibility Manager
2013-12-16 16:25:15, Info DISM DISM.EXE: Succesfully registered commands for the provider: Compatibility Manager.
2013-12-16 16:25:15, Error DISM DISM.EXE: Failed to access the image folder or image's windows folder.
2013-12-16 16:25:15, Info DISM DISM.EXE: Image session has been closed. Reboot required=no.
2013-12-16 16:25:15, Info DISM DISM.EXE:
2013-12-16 16:25:15, Info DISM DISM.EXE: <----- Ending Dism.exe session ----->
2013-12-16 16:25:15, Info DISM DISM.EXE:
2013-12-16 16:25:15, Info DISM DISM Image Session: PID=7240 Disconnecting the provider store - CDISMImageSession::Final_OnDisconnect
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Disconnecting Provider: WimManager - CDISMProviderStore::Internal_DisconnectProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Disconnecting Provider: FolderManager - CDISMProviderStore::Internal_DisconnectProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Found the OSServices. Waiting to finalize it until all other providers are unloaded. - CDISMProviderStore::Final_OnDisconnect
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Disconnecting Provider: Compatibility Manager - CDISMProviderStore::Internal_DisconnectProvider
2013-12-16 16:25:15, Info DISM DISM Provider Store: PID=7240 Releasing the local reference to DISMLogger. Stop logging. - CDISMProviderStore::Internal_DisconnectProvider

0
Login to vote
Terry BU's picture

this image has been mounted to that location before you ran this command?

 

2013-12-16 16:25:15, Error DISM DISM.EXE: Failed to access the image folder or image's windows folder.

0
Login to vote
anandkumar's picture

Hi Terry,

I am getting error message after  enterin this cmd

dism /mount-wim /wimfile:c:\winpe\winpe.wim /index:1 /mountdir:c:\winpe\mount

 

Error.JPG
0
Login to vote
Terry BU's picture

good news, this may be an easy fix.  your image shows you have this as the command:

dism /mount-wim /wimfile:c:\winpe\winpe.wim /index:1 /mountdor:c:\winpe\mount

 

note you have "mountdOr" not "mountdir" at the end of the line

0
Login to vote
anandkumar's picture

Thanks Terry

I am not able to find the following files copy.bat, ghostoem32 and ghvp.bat in the console partition.

I am also getting the error message while executing this command

dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"

dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-Scripting.cab"

dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-WMI.cab"

 

Error3.JPG
0
Login to vote
Terry BU's picture

the error is that it cannot find the image.  2 questions:

1) did you mount it

2) are you setting the variable %_location%

you use that variable a lot, and i did talk about it in my article, but if you dont set it before you make that call it will fail

0
Login to vote
anandkumar's picture

I have created the Winpe3.

Whiel trying to create the Image I am getting this error message

Error.JPG
0
Login to vote
Terry BU's picture

thats interesting.  my boot image is 150MB.  did you build that off of the WinPE or WinPE512 in the very beginning (when you used Ghost Boot Wizard to build the folder)?

0
Login to vote
anandkumar's picture

Terry, I am not able to find the following files copy.bat, ghostoem32 and ghvp.bat in the console partition.

wht can be done for this?

0
Login to vote
Terry BU's picture

were the rest of the files there?  they should all be visible in a regular Ghost Boot Partition if you view it in Ghost Explorer

0
Login to vote
anandkumar's picture

@ Terry I used the WinPE copy and named it as WinPE3.

I found the file copy.bat and ghvp.bat but not able to find the ghostoem32 in the regular Ghost Boot Partition.

For the %_location% should we use the c:\winpe or the holding folder c:\bootcd\makepe.

While adding the driver for the DELL Latitude E7440 for this command "dism /image:c:\winpe\mount /add-driver /driver:c:\bootcd\makepe\winpedrivers32 /recurse"

Let me know which driver need to added for the folder.

Driver.JPG Driver1.JPG
0
Login to vote
Terry BU's picture

location would be where the WIM mounted, so in this case, c:\winpe is what i used in the article.

you add any drivers you need to make your PE work.  Since this is a WinPE3 image, you would use Windows 7 drivers.  go with 32bit or 64bit, depending on the architecture you chose when makeing the PE image

0
Login to vote
anandkumar's picture

Thanks Terry. But I did not find the ghostoem32 in the regular Ghost Boot Partition.

For this command {set path=%path%;x:\Program Files;x:\ghost;x:\scripts;} I have set the path c:\bootcd\makepe\scripts. For "x" we need to provide the path like "c:\winpe\mount" or it will take the default path.

 

 

 

0
Login to vote
Terry BU's picture

x:\ is because when the PE boots up, it will create a RAM drive and store all of its stuff there.  by default, that is the X drive

0
Login to vote
3Phase's picture

@terry BU

Hey Terry

Im having trouble finding the ghostoem NGCTW32 exe.s among others in this part of the instruction?
Could you please specify the file path you found yours at to give me a clue if in the right place .
I have opened up an image we use and A boot disc we use none of them have an easily found ghost folder.
Is there a way to get these files than the way stated above?

thanks,

0
Login to vote
Terry BU's picture

take an actual Ghost Boot Wizard made boot .gho file that you made.  Open it in Ghost Explorer.  you will see a folder named "Ghost".  all those files (ngctw32 included) are in that folder.  export them to your holding area so you have them for your PE image that you will make!

0
Login to vote
Terry BU's picture

tommax, my email for this thread says you posted:

I am getting this error when trying to access my .cab files. Error: 3 Unable to access the image. Make sure that the image path and the Windows directory for the image exist and you have Read permissions on the folder.Capture.PNG

but the text box is just blank when i try to reply....

so i posted it here again

 

does your %_location% variable resolve to the correct place?  i cant see what command you ran to mount it, only that it says it did.

0
Login to vote
tommax01's picture

Sorry. I thought you answered this question earlier. I am new to this and don't really know how to check and see if it is resolving to the corect place. I am following your instructions, but I am obviously missing something. How would I check to make sure it's resplving to the correct place? My commandprompt is reading c:\winpe

0
Login to vote
Terry BU's picture

when you create the location of the pe with the tools, it will auto take you to the directory you just made.  that is both good and bad.  the question is does your variable resolve?

you can test that by typing "ECHO <variable>" into the command prompt.  it will show you what it resolves to

so 

ECHO %_location%

should give you a directory name.  does that directory exist?

0
Login to vote
tommax01's picture

I get the return of %_location%

Capture.PNG
0
Login to vote
Terry BU's picture

its telling you that %_location% is not set to anything.  you have to set the %_location% variable to something, or remove it and put in the actual location

for example, you could put this at the top of your script:

 

echo off
set /p _location= What directory did you make for your PE: 
echo on

 

that will cause it to prompt you, and set your answer as the value for %_location%

0
Login to vote
tommax01's picture

Looks like it's working. Thanks for the help!

0
Login to vote
Terry BU's picture

no problem!  glad to hear you worked through it.

0
Login to vote
tommax01's picture

Hi Terry,

       Have you seen this error before. I am trying to pull an image from a machine with the new Winpe3 Boot.WIM I copied and I am getting this error. VOlume Full.My BOOT.WIM file is about 143MB.volume full.PNG

0
Login to vote
Terry BU's picture

no, BUT!  there is a previous article from Symantec here:

https://www-secure.symantec.com/connect/forums/vol...

that talks about getting that error and how to solve it!  seems to be an easy fix!

+1
Login to vote
TxAdmin's picture

Hi Terry,

This solution does not fix the "Volume Full Error". I tried changing the manifest files both on Win-PE and Winpe-512. Any other suggestions?

0
Login to vote
tommax01's picture

Thanks, I got it to reboot from the console, but Ghost seems to crash after it boots into Winpe. All i get is one screen command screen. All is working from my flash drive, just not when I go to the console. I have the client selected to use the new Boot Environment. 

0
Login to vote
Terry BU's picture

so it boots up and opens the new console window that pings your ghost server, but only if booting from the key?

when booting from the console (if its not working), does the console give an error (besides that it timed out if it cannot connect)?

0
Login to vote
tommax01's picture

All it does is give the Virtual Partition timed out error. I am going to make another one, I may have left a file out, but at least my usb is working and for now that is way better than we had. I couldn't find a few files, so I'm downloading the GSS update and will remake my BOOT.WIM with the files (Hopefully) and see how the console likes that.

0
Login to vote
Terry BU's picture

out of curiousity, do you get an IP address if you run ipconfig?  if you do, it is not running your startnet.cmd file

0
Login to vote
tommax01's picture

It did receive an IP address. I am still working on it from the Console, but a USB works just fine, and that's enough to get us started. 124 laptops to image. :)

0
Login to vote
Terry BU's picture

while in the PE from the console, if you open your startnet.cmd file on the X: drive, is your script/commands/whatever in it?

0
Login to vote
Gh0stRyd3r's picture

Ok we got the PE to boot but when it is attempting to connect the commandline shows the Cert key push but it has the wrong server IP and we tried changing the client from host name to IP but not change. It connects fine when the Clone PC is booted but when it tries to connect to the server for the session it has the wong IP?

0
Login to vote
tommax01's picture

I went back through from scratch and now it seems to be working fine for both the console and a USB drive.

 

Thanks again for the walkthrough.

0
Login to vote
Terry BU's picture

no problem!  i figured other people would be in the same situation as me, and could take it as a guide to help them!

0
Login to vote
TxAdmin's picture

Terry BU,

Thanks for the documentation. I successfully imaged a machine via the console. However, I am getting the following error while doing a Configuration task. "An error occured on the cleint but the error could not be retreived" Any Suggestions?error.jpg

0
Login to vote
Terry BU's picture

2 questions:

first, what step did it error out on (that is covered by the event details)?

second, is this a standalone config task, or is it doing other things too?

 

i ask because using the new PE, i cannot clone and config in the same task unless i booted to the PE using the USB key

0
Login to vote
TxAdmin's picture

Thanks Terry,

Didn't think you would respond so soon!

1st Failed on Configuration.

2nd It is a standalone task. 

I read one of your comments earlier on being able to either clone or config on a single task. I am able to clone on a single task, but not config on a single task. The USB is not an option for me (too many machines)

Thank You

 

0
Login to vote
Terry BU's picture

would you mind reposting that picture so all the steps can be seen?  i am curious to know what the line that reads "failure" also says.

 

i use the USB key for bringing new machines into the console.  i dont visit every one by hand to restore.  my new PE works for the restore (i have to assign that PE to the machine), but it will fail on the config part.  at that point (the failure), it reboots, syspreps, etc.  i then run a config on it, and it reboots again, runs the config, and is good to go.  i just cant run a clone AND config in the same task, but it works if it was already in the PE....

0
Login to vote
Terry BU's picture

why is it running a DOS client upgrade?
does the machine have the newly made PE set as its PE to use during those steps?

0
Login to vote
TxAdmin's picture

Terry,

I am not sure, I am using the PE from your documentation. Yes the client has the new PE set. Is there a way to disable the DOS client upgrade step?

0
Login to vote
Gh0stRyd3r's picture

Terry BU thanks for this great  document it was a great help, unfortunaly we are depended upon the client initated boot to virtual partition and we had to call Symantec. They were able to supply us with a working manifest and boot.wim for PE3.0.

0
Login to vote
Terry BU's picture

some things are just out of your control!  the good news is you can kind of figure out the process if you ever had to do it!

0
Login to vote
TxAdmin's picture

Terry,

I am not sure, I am using the PE from your documentation. Yes the client has the new PE set. Is there a way to disable the DOS client upgrade step?

0
Login to vote
cubiles's picture

Hello Terry, 

 

Thank you so much for this wonderful article! I was racking my brain over this issue for a while... I was able to create a bootable USB and everything seemed to be going just fine but now I'm at a point where it will start the ngctw32.exe but it gets stuck in a loop where the client PC will send a status to the ghost server and it will be acknowledged by it but it doesn't go any further than that. So it's an infinite loop of "sending status" and "acknowledged by"... 

 

On the ghost console I can see that it is detecting the machine because it shows an icon with the clients MAC address but it won't do anything. In ghostcast server the client is not accepted. 

 

Any suggestions?

0
Login to vote
itsnetops's picture

I am trying to run the following commands to no avail... I get the below output... PLEASE HELP

 

Now, back to that command prompt.  run the following commands:

  1. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"
  2. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-Scripting.cab"
  3. dism /image:%_location%\mount /add-package /packagepath:"C:\program files\windows aik\tools\petools\x86\winpe_FPs\WinPE-WMI.cab"

 

DISM1.PNG DISM2.PNG
0
Login to vote
Terry BU's picture

is the image corrupt?  it looks like it is telling you it is already mounted, but then asking you to remount it

 

have you tried unmounting the image and remounting it before running the command?

has this happened to you every time or did it just start after working for a while?

0
Login to vote
itsnetops's picture

Terry,

 

I don't think the image is corrupt. I can try to unmount the image (is there a command that I need to run to unmount?). 

 

This was my result from the beginning and has never worked.

0
Login to vote
Terry BU's picture

dism /unmount-wim /mountdir:%_location%\mount /commit

 

keep in mind that command as it is will commit the changes to the WIM.

if you want to discard them, use

dism /unmount-wim /mountdir:%_location%\mount /discard

0
Login to vote
itsnetops's picture

Unmount and remount seemed to do the trick!

 

Thanks a mil.

0
Login to vote
dwils15's picture

when i go through the process i run into this:

c:\winpe>dism /image:c:\winpe\mount /add-package /packagepath:"C:\program files\
windows aik\tools\petools\x86\winpe_FPs\WinPE-HTA.cab"

Deployment Image Servicing and Management tool
Version: 6.1.7600.16385

Error: 50

DISM does not support servicing a Windows Vista RTM or earlier operating system.

If the operating system is supported check that SSShim.DLL is present.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

c:\winpe>

 

This is on a win7x86 machine with the win7 aik and supplement installed.

0
Login to vote
DougC's picture

Just wondering if you found a soultion yet for the "clone and config" in the same task issue?

 

Thanks

Doug

 

0
Login to vote
Terry BU's picture

i have not, sorry

 

i did have a brand new set of computers succeed on a single clone and config task that started from a regular windows install, but i have not been able to reproduce it, even on the same machines!

0
Login to vote
BC_IT's picture

    This article has been a great starting point for me. I had to make some modifications for my specific use as well as to be able to use it in the Ghost Console. Using the method described in this article I ran into 2 issue with the console.

 

     The first was that the console was detecting that the manifest did not have the correct drivers listed for machines I am using. So what I did was first go into the Ghost Boot Wizard and copy the WinPE to a new WinPEtmp. Then I edited the WinPEtmp and added all the WinPE3 drivers I needed, even though they would not work with the original WinPE this method added the correct entries in the driver manifest so that is would detect that it has the drivers. Then I followed the remaining instructions to create the WinPE3 PreOS.
 

     The second issue I was receiveing had to do with the size of the .wim file. It would error out stating that the .wim file was the wrong one. I received the following error message.

Details for: To Virtual Partition

The File"{manifest}\\Sources\\boot.wim" (size 151MB) is too large for the size (120MB) specified for this PreOS.

 

So what I had to do was to go into C:\ProgramData\Symantec\Ghost\Template\common\WinPE3\Manifest.txt

Find the following section

path = "{manifest}\\sources\\boot.wim", size = 120}

and change size = 120 to size = 151

After doing that all was well.

 

Additionally I created a .HTA to act as a front end to prevent anyone from accessing a command prompt to compromise the Hard Drive.

Here is what I did differently with the Startnet.cmd, Startghost.cmd and the added .htas

Startnet.cmd

         wpeinit
         wpeutil disablefirewall
         Start /min cmd /c x:\scripts\setpath.cmd
         Start /min cmd /c x:\scripts\startGhost.cmd
         x:\HTA\Sleep.HTA
         x:\HTA\FrontEnd.HTA
         exit
 

I ran the set PAth and StartGhost as seperate processes so that they could run in the background.

I added an Exit to the end of StartGhost so that in the event someone was able to access that command window and canceled the process the next thing to happen would be to close the window.

StartGhost.cmd

         rem --- This will remove any traces of virtual partition from hard drive ---
         x:\ghost\gdisk32.exe /revert  >> x:\ghost\startlog.txt
 
         rem --- This will create primary OS drive configuration ---
         x:\ghost\ghost32.exe /setosdrives /blind >> x:\ghost\startlog.txt

         rem --- This will contact the Ghost server
         x:\ghost\ngctw32.exe -console

         exit

 

Next I ran a simple .hta to sleep for a few seconds to give startghost a chance to get going, Otherwise it would end up running ngctw32.exe on top of everything else.

sleep.hta

<Html>
<Head>
<Title>Sleep</Title>
<HTA:Application
Caption = no
WindowState=minimize
Border = none
ShowInTaskBar = Yes
SingleInstance = no
MaximizeButton = No
MinimizeButton = Yes>
 
 <script Language = VBScript>
 
  Dim idTimer
 
  Sub Window_OnLoad 
  idTimer = window.setTimeout("ExitHTA",5000, "VBScript")
 End Sub
 
 Sub ExitHTA
  self.close()
 End Sub
 
</script>

<body>
</body>

</head>
</html>

Next I created an HTA script to run and not allow interaction without Logging in. I was able to prevent Alt+F4 but not Alt+Tab but I found a different way to handle that at the end.

FontEnd.HTA

Now I formatted the body to work with my specific background image x:\Windows\System32\winpe.bmp

and I obviously changed my username and password on line 69 for security reasons.

<Html>
<Head>
<Title>Support Information</Title>
 
<HTA:Application
Caption = no
WindowState=maximize
Border = none
ShowInTaskBar = Yes
SingleInstance = no
MaximizeButton = No
MinimizeButton = Yes>
 
<script Language = VBScript>
 
 Dim boolPasswordEntered
 Dim idTimer
 
 boolPasswordEntered = False
 
 Sub Window_OnLoad 
  Document_onKeyDown()
  Show_LogIn
  Hide_Info
  GetInfo
 End Sub
 
 Sub Show_Hide_Info
  if boolPasswordEntered = True Then
   If span_MACAddress.style.visibility="visible" Then
    span_MACAddress.style.visibility="hidden"
    span_ipaddress.style.visibility="hidden"
    span_subnetmask.style.visibility="hidden"
    span_defaultgateway.style.visibility="hidden"
    span_primarydns.style.visibility="hidden"
    span_secondarydns.style.visibility="hidden"
   Else
    span_MACAddress.style.visibility="visible"
    span_ipaddress.style.visibility="visible"
    span_subnetmask.style.visibility="visible"
    span_defaultgateway.style.visibility="visible"
    span_primarydns.style.visibility="visible"
    span_secondarydns.style.visibility="visible" 
   End If
  Else
   errorMsg = msgbox("Please Log In",0,"Error")
  End If
 End Sub
 
 Sub Hide_info
   span_MACAddress.style.visibility="hidden"
   span_ipaddress.style.visibility="hidden"
   span_subnetmask.style.visibility="hidden"
   span_defaultgateway.style.visibility="hidden"
   span_primarydns.style.visibility="hidden"
   span_secondarydns.style.visibility="hidden" 
 End Sub
 
 Sub Hide_LogIn
  GetLogin.style.visibility="hidden"
 End Sub
 
 Sub Show_LogIn
  GetLogin.style.visibility="visible"
 End Sub
 
 Function CheckPassword 
  Show_LogIn
  If  (Username1.value = "USERNAME" ) and (UserPassword1.value = "PASSWORD") Then
   boolPasswordEntered = True
   Hide_LogIn
  Else
   errorMsg = msgbox("Incorrect username or bad password",0,"Error")
  End If
 End Function
 
 Function Log_Out
  If boolPasswordEntered = True Then
   Hide_Info
   boolPasswordEntered = False
   Show_LogIn
   Username1.value = ""
   UserPassword1.value = ""
  End If
 End Function
 
 Function Timeout
  window.clearTimeout(idTimer)
  idTimer = window.setTimeout("Log_Out",120000, "VBScript")
 End Function
 
 Function Document_onKeyDown()

  Dim alt
  alt = window.event.altKey
  Select Case window.event.keyCode
   Case 27,116
    window.event.keyCode = 0
    window.event.cancelBubble = true
    Document_onKeyDown = False
   Case 115
    If alt Then
     window.event.keyCode = 0
     window.event.cancelBubble = true
     Document_onKeyDown = False
    End If
   Case Else
    Document_onKeyDown = True
  End Select

 End Function

 Function RunCMD
  Dim oShell
  Set oShell = CreateObject("WScript.Shell")
  If boolPasswordEntered = True Then
   oShell.run "cmd.exe"
  Else
   errorMsg = msgbox("Please Log In",0,"Error")
   Show_LogIn
  End If
 End Function
 
 Function RunGhost
  Dim oShell
  Set oShell = CreateObject("WScript.Shell")  
  If boolPasswordEntered = True Then
   oShell.run "X:\ghost\ghost32.exe -fro"
  Else
   errorMsg = msgbox("Please Log In",0,"Error")
   Show_LogIn
  End If
 End Function
 
 Function GetInfo
  strIPInfo = GetIPInformation()
  If InStr(strIPInfo, ";") > 0 Then
   arrIPInfo = Split(strIPInfo, ";")
   If UBound(arrIPInfo) >= 3 Then
    span_ipaddress.InnerHTML = "IP Address: " & arrIPInfo(0)
    span_subnetmask.InnerHTML = "SubnetMask: " & arrIPInfo(1)
    span_defaultgateway.InnerHTML = "Deafult Gateway: " & arrIPInfo(2)
    span_primarydns.InnerHTML = "Pri DNS: " & arrIPInfo(3)
    If UBound(arrIPInfo) = 4 Then
     span_secondarydns.InnerHTML = "Sec DNS: " & arrIPInfo(4)
    End If
   End If
  End If
  GetMac
 End Function
 
 Function GetIPInformation()
  strComputer = "."
  Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  Set colNetAdapters = objWMIService.ExecQuery _
   ("Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=True")
  strDetails = ""
  For Each objAdapter In colNetAdapters
   If IsNull(objAdapter.IPAddress) = False And IsNull(objAdapter.DefaultIPGateway) = False Then
    If Join(objAdapter.IPAddress) <> "0.0.0.0" Then
     If strDetails = "" Then
      strDetails = Join(objAdapter.IPAddress) & ";"
      strDetails = strDetails & Join(objAdapter.IPSubnet) & ";"
      strDetails = strDetails & Join(objAdapter.DefaultIPGateway) & ";"
      strDetails = strDetails & Join(objAdapter.DNSServerSearchOrder, ";")
      
     End If
    End If
   End If
  Next
  GetIPInformation = strDetails
 End Function
 
 Sub GetMac
  strComputer = "."
  Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
  Set colItems = objWMIService.ExecQuery("Select * From Win32_NetworkAdapterConfiguration Where IPEnabled = True")
  For Each objItem in colItems
   IF IsNull(objItem.DefaultIPGateway) = False Then
    strHtml = strHtml & objItem.MACAddress & "</Br>"
   End If
  Next
  span_MACaddress.InnerHtml = "MAC Address: " & strHtml
 End Sub
 
 Sub ExitHTA
  If boolPasswordEntered = True Then
   self.close()
  Else
   errorMsg = msgbox("Please Log In to Exit",0,"Error")
   Show_LogIn
  End If
 End Sub
 
 Function ShowPc
  If PcInfo.style.visibility="hidden" Then
   PcInfo.style.visibility="visible"
  Else
   PcInfo.style.visibility="hidden"
  End If
 End Function
 
</script>
<body onkeyup=Timeout background = "x:\windows\system32\WinPE.bmp">
 <table width= "90%" border="0" align="center">
  <span id="PcInfo">
   <tr>
    <td align="center" colspan="2">    
     <h2 style="font-size:18pt" style="color:#FFFF00">IT Maintenance. Please do not shutdown or restart</h2>
    </td>
   </tr>
    <td>
     <Font color = #FFFF00><span id="span_MACaddress"></span>
    </td>
    <td>
     
    </td>
   </tr>
   <tr>
    <td>
     <Font color = #FFFF00><span id="span_ipaddress"></span>
    </td>
    <td>
    </td>
   </tr>
   <tr>
    <td>
     <Font color = #FFFF00><span id="span_subnetmask"></span>
    </td>
    <td>
     
    </td>
   </tr>
   <tr>
    <td>
     <Font color = #FFFF00><span id="span_defaultgateway"></span>
    </td>
    <td>
     
    </td>
   </tr>
   <tr>
    <td>
     <Font color = #FFFF00><span id="span_primarydns"></span>
    </td>
    <td>
     
    </td>
   </tr>
   <tr>
    <td>
     <Font color = #FFFF00><span id="span_secondarydns"></span>
    </td>
    <td>
     
    </td>
   </tr>
  </span>
 </table><br><br><br>
 
 <table width= "90%" border="0" align="center">
  <tr align="Left">
   <td>
    <span id="GetLogin">
     </Br>
     </Br>
     </Br>
     </Br>
     </Br>
     <Font color = #FFFF00>Please enter credentials and click OK</Br>
     <Font color = #FFFF00> Username:
     <input type="text" name="UserName1"> </Br>
     <Font color = #FFFF00> Password:
     <input type="password" name="UserPassword1"> </Br>
     <input type="button" value="OK" name="OK" onclick="CheckPassword"><p>
    </span>
    <input type="button" value="Exit" name="run_button"  onClick="ExitHTA">
    <input type="button" value="Command Window" name="CMD" onClick="RunCMD">
    <input type="button" value="Ghost" name="Ghost" onClick="RunGhost">
    <input type="button" value="Show/Hide PC Info" name="PcInfo" onClick="Show_Hide_Info">
    <input type="button" value="Log Out" name="LO" onClick="Log_Out">
    </td>
  </tr>
 </table>
</body>
</head>
</html>

Finally the last entry in the Startnet.cmd is Exit. That way if someone is able to close out the .hta application it should nearly immediately exit.

I am sure that this is not a full proof set up but that was not my intention. What was my intention was to make it difficult enough to make it take some time. To put it in simple terms. Keep the honest thieves out.

 

0
Login to vote
Mohamed Saleem's picture

C:\winpe>dism /image:%_location%\mount /add-package /packagepath:"C:\Program
Files\Windows Kits\8.0\Assessment and Deployment Kit\Windows Preinstallation Env
ironment\x86\WinPE_OCs\WinPE-HTA.cab"

Error: 87

The Image option has been duplicated on the command-line.
Remove the duplicate option and try the command again.

The DISM log file can be found at C:\Windows\Logs\DISM\dism.log

 

Please help me I ran the above command 2 times and i got this error 87

0
Login to vote